All posts

Laravel’s TokenGuard bypass: am I affected, and what to patch.

CVE-2026-114509 (CVSS 9.2) lets an unauthenticated attacker act as an existing user on routes behind Laravel’s TokenGuard. Fixed in 12.68.0 and 13.29.0.

Published
Reading time
6 min
By
Girish Babu GV

What happened#

On 19 October 2026 the Laravel team published a security advisory for laravel/framework. It says that Laravel’s TokenGuard, when used as a standard token-based API guard, can be bypassed to authenticate as an existing user without that user’s API token. The mechanism it describes: under certain MySQL and MariaDB configurations, a specially crafted credential that is not a string is mishandled during the user lookup, so the query matches a user it should not. The advisory gives no more detail than that, and I am not adding any.

The advisory’s impact line is plain: an unauthenticated attacker could take over accounts on routes protected by the affected guard. It was reported by KIKOmanasijev. GitHub added the same advisory to its reviewed Advisory Database on 23 October, where it is tagged CWE-287 (improper authentication) and CWE-1287 (improper validation of the type of input), and shows an EPSS exploit-likelihood estimate of 0.777%.

Key facts from the advisory
ItemValue
CVE / advisoryCVE-2026-114509 / GHSA-f9x3-7vq9-cph6
SeverityCritical, CVSS 4.0 base score 9.2 (network, no privileges, no user interaction)
Packagelaravel/framework (Composer)
AffectedBelow 12.68.0; and 13.0.0 up to below 13.29.0
Patched12.68.0 and 13.29.0 (and later)
Database conditionMySQL or MariaDB, under the configurations the advisory describes
WorkaroundsNone listed

The fix, in commit 8dbb08b, is small. According to the commit, TokenGuard now accepts a token only if it is a non-empty string, and validate() returns false for non-string input. Before, it only checked that the value was not empty. Two new tests cover both cases.

Am I affected?#

The advisory scopes the bug narrowly, so the useful question is which of these you can answer “yes” to. You are in the risk zone only if all of them hold.

What has to be true
ConditionWhere to look
laravel/framework is older than 12.68.0 (or a 13.x older than 13.29.0)composer.lock, or composer show laravel/framework on the running server
Some route is protected by the built-in token guardconfig/auth.php (guards) and the auth: middleware on your routes
The database is MySQL or MariaDBconfig/database.php and your .env DB_CONNECTION

What I can’t tell you from the sources is how other authentication setups fare. The advisory and the fix are both about TokenGuard. They don’t mention session login or any other package, so I won’t claim that those are or aren’t affected. Trace the actual guard your protected routes use.

What to do now#

  1. Find the version that is actually running, not just the one in your repo. A lockfile updated on a laptop says nothing about production.
  2. Update to 12.68.0 or later on the 12.x line, or 13.29.0 or later on 13.x. The advisory lists no workaround, so upgrading is the remediation it describes.
  3. Deploy and re-check the installed version on the server after the deploy.
  4. Look at your logs for API requests that don’t look like normal client traffic. The sources I read don’t say whether the bug is being exploited, so I can’t tell you what to look for beyond that.
Check, then update
# Which version is installed?
composer show laravel/framework

# Update within your major line, then deploy
composer update laravel/framework

# Confirm after the deploy, on the server itself
composer show laravel/framework | grep versions

What the sources don’t say#

  • Whether anyone has exploited this in the wild. The advisory doesn’t mention it either way.
  • Exactly which MySQL or MariaDB configurations trigger it. The advisory says “certain” ones without listing them.
  • Whether anything beyond the built-in TokenGuard is affected. Neither the advisory nor the fix commit says so.
  • The specifics of the flaw. Neither advisory page spells out the exact input or code path beyond the one-sentence description above.

My take#

My own opinion, not from the advisory.

A 9.2 with a two-week-old fix is the kind of thing that slips: nobody is shouting, and the affected pattern (a plain token guard on a MySQL-backed API) is easy to forget you have. I’d treat it as a ten-minute check this week. The fix itself, “only accept a string”, is also a good reminder to validate the type of anything that goes into a database lookup, not just its presence.

Sources#

Keep reading

Esc