Your login can be fooled by a zero
PHP's bad week wasn't over. While everyone was patching PHP2Shell, Laravel published another advisory: CVE-2026-114509. This time the problem isn't underneath your application. It's at the door.
The card that wasn't a card
Many Laravel APIs work like this: the client sends a token, Laravel looks it up in the users table and, if it matches, you're in as that user. That's TokenGuard's job, the guard with the token driver.
The flaw, in one sentence: TokenGuard only checked that the token wasn't empty, not that it was text.
So the attacker doesn't send a token. They send a number inside a JSON body. Enter MySQL (or MariaDB): when you ask it to compare text with a number, it turns the text into a number. A token like a8f3c1… becomes 0, and most tokens end up with the same value. The attacker gets in as the first user that "matches". No password, no knowledge of any token.
Rated 9.2 out of 10 (9.8 on the older scale). Public exploits are on GitHub.
The twist: the fix had been out for eight weeks
This is the interesting part:
- August 25: Laravel 12.68.0 and 13.29.0 ship, with the fix inside.
- October 19: the security advisory is published.
- Days later: proofs of concept show up on GitHub.
If you ran composer update in September, you were safe without knowing it. If not, since October 19 anyone knows how to get in.
Am I affected?
- Check
config/auth.php. If any guard uses'driver' => 'token', that's the affected one. - Did your project start between 2016 and 2021? Laravel's skeleton shipped the
apiguard with that driver by default. You may have it enabled without ever choosing it. - Using Sanctum or Passport? The advisory doesn't mention them; they use their own guards. Still, make sure no
tokenguard is lingering in your config. - Check the version:
composer show laravel/framework. You need 12.68.0 or 13.29.0 at least. - Laravel 11 or older? The advisory names no fix for those branches, and Laravel 11's security support ended in March. Time to upgrade.
No configuration setting replaces it: the fix is updating.
Try it yourself
This one you can actually watch get in and get shut out on your own machine, because the "exploit" is sending a number. There's a Docker lab with a minimal mock-up: docker compose up -d and sh demo.sh run four cases. You'll see how, in vulnerable mode, a 0 gets in as the first user without knowing any token, and how patched mode rejects that same 0 before touching the database. The code is commented line by line so you can see the type trick.
This is as far as it goes. It's the full effect, but harmless: reproducing "send a 0" is not a weapon, and the mock-up only talks to itself, it touches nothing outside. It isn't Laravel: it's a reproduction of the one line that failed, to understand why. To find out whether your project is affected, use the list above.
Code and instructions: github.com/inigoaldama/en-30-segundos-labs.
The moral
Two weeks, two similar lessons. With PHP2Shell, the flaw was underneath your code. With Laravel, it was in a line nobody looked at because "it only checks it isn't empty". In both cases, what saved you was the same thing: updating often, even when no headline asks you to.
Iñigo Aldama · aldama.net
Sources: GitLab Advisory Database · Laravel 12.68.0 (GitHub) · Laravel 13.29.0 (GitHub) · Convika · SecurityOnline (PoC) · The Hacker News