
Simulasi type juggling & implicit type conversion CVE-2026-114509 pada query autentikasi
Reference repository and forensic testing tool for the article: "Type Juggling Authentication Bypass: CVE-2026-114509" by Nextmend.
The critical vulnerability CVE-2026-114509 (GHSA-f9x3-7vq9-cph6) in the Laravel framework demonstrates the danger of implicit type conversion in authentication queries:
api_token[]=0 confuses the built-in authentication guard (Illuminate\Auth\TokenGuard). The check ! empty($token) evaluates to true (true) because the array contains one non-empty element.EloquentUserProvider::retrieveByCredentials(), which automatically converts the array into a WHERE api_token IN (0) clause.VARCHAR is compared with the integer 0, the MySQL engine performs implicit type coercion. A string beginning with an alphabetic character is converted to the integer 0.0 = 0 evaluates to true (true), so the query ->first() returns the first row of the users table (typically the administrator account with ID 1). The attacker successfully logs in without a valid token.tests/test-cve-2026-114509-type-juggling.php: Test and simulation scripts for the parameter parsing flow, Eloquent query compilation, MySQL vs PostgreSQL database evaluation, and proof of the is_string() patch.php tests/test-cve-2026-114509-type-juggling.php
laravel/framework to version >= 12.68.0 or >= 13.29.0 (strict check is_string($token)).'api_token' => 'required|string').hash('sha256', $token)) instead of raw string comparison in SQL queries.