Un fichier PHP, zéro dépendance : dit si laravel/framework est encore sous le correctif TokenGuard (CVE-2026-114509). Aucun exploit, aucun réseau.
One PHP file. No Composer. No network. No exploit.
Laravel's token guard used to authenticate a request when the credential was not a string. On MySQL and MariaDB that lookup can match a different user. The check that refuses a non-string token landed in August 2026. The advisory, GHSA-f9x3-7vq9-cph6 (CVE-2026-114509, CVSS 4.0 9.2), was published on 19 October. A composer.lock from September can still be on the wrong side of it.
Un fichier PHP. Zéro Composer. Aucun appel réseau. Aucun exploit.
Le token guard de Laravel acceptait une requête dont le jeton n'était pas une chaîne. Sur MySQL et MariaDB, la recherche peut alors tomber sur un autre utilisateur. Le contrôle qui refuse un jeton non-string est d'août 2026. L'avis, publié le 19 octobre, est GHSA-f9x3-7vq9-cph6 (CVE-2026-114509, CVSS 4.0 9.2). Un composer.lock de septembre peut encore être en dessous.
curl -fsSL -o tokengate.php \
https://raw.githubusercontent.com/Nguemoue/project2026_20261030_tokengate/main/tokengate.php
php tokengate.php --self-test
php tokengate.php /path/to/your/laravel
TokenGuard loads the user with the credential it was given. Before the fix, the only gate was empty(). A non-string value can pass that and reach the query. The advisory says that under MySQL or MariaDB the query can match an existing user who was not the one the request named, on any route protected by that guard. Sanctum and Passport do not use this class.
The fix is commit 9b21ce0. user() continues only when is_string($token) && ! empty($token). validate() returns false unless the credential is a non-empty string. This tool does not show how to build the bad credential.
TokenGuard.php was compared on the framework tags, not only against the advisory sentence:
| Branch | String check present from | Advisory's patched release |
|---|---|---|
| 13.x | 13.27.0 (file identical in 13.27.0, 13.28.0 and 13.29.0) | 13.29.0 |
| 12.x | 12.68.0 | 12.68.0 |
| 11.x | 11.56.1 | not named; the advisory lists 12.68.0 and 13.29.0 |
| 10.x and older | never | none (end of security support) |
13.27 and 13.28 are not reported as critical: the guard file already matches 13.29.0. They are still behind the number the advisory tells you to install, so tokengate prints that and stays at medium. 12.67 and 11.56.0 do not have the check. 10.x never received it.
There is no workaround in the advisory. Updating the framework is the fix. Restart PHP-FPM, Octane and the queue workers after deploy, or they keep the old file in memory.
tokengate 1.0.0 CVE-2026-114509
CRITICAL exposed
laravel/framework v12.40.2 is below the TokenGuard fix 12.68.0. Guard [api]
uses driver "token". DB_CONNECTION is mysql (.env.example), which is the
database named in the advisory.
framework v12.40.2 (composer.lock)
token guard api config/auth.php, hash false
Update laravel/framework to 12.68.0 or later. The advisory lists no
workaround. Restart PHP-FPM, Octane and queue workers afterwards so no
process keeps the old file.
Exit 1: findings at or above high.
examples/exposed-12 is guilty on purpose. examples/patched-12 is the same guard on 12.68.0 and exits 0. examples/sanctum-old is an old 13.10 lock whose api guard is Sanctum: the token-guard bug is not that code path, so the default run does not fail. It still tells you the framework is below the fix.
The report names the guard, the file and the database driver. It does not read tokens out of .env and it does not print a request.
| Severity | Verdict | What it means |
|---|---|---|
| critical | exposed | The installed tag has no string check, a guard uses driver => token, and DB_CONNECTION is mysql, mariadb, or missing. |
| high | exposed | Same, but the configured database is not MySQL or MariaDB. The published trigger is those two. The old guard is still the wrong code to ship. |
| high | no-lock / unknown-version / version-and-unclear-guard | Laravel is required, and tokengate cannot prove the fix is installed. A ^12.0 constraint is not a version. dev-master is not a version. env('API_DRIVER') with no default and no .env value hides the driver. |
| medium | unpatched-without-token-guard | Old framework, but every guard driver found is a literal other than token (usually sanctum or session). |
| medium | guard-fixed | The string check is in this tag, and the tag is still below the advisory's number (13.27 and 13.28). |
| ok | patched | 11.56.1+, 12.68.0+, or 13.29.0+. |
| ok | not-laravel | laravel/framework is not required. |
Default CI fails on high. Medium is printed and does not fail unless you ask.
A cached bootstrap/cache/config.php wins over config/auth.php when tokengate can read it, because that is the config production actually booted.
php tokengate.php # the current directory
php tokengate.php /var/www/app
php tokengate.php --json # stdout is JSON only
php tokengate.php --fail-on=medium # also fail when the guard is absent but unused
php tokengate.php --fail-on=never # always exit 0, still print the report
php tokengate.php --no-color
php tokengate.php --self-test # built-in fixtures, no network
Exit 0 when nothing reaches the fail level (default: high). Exit 1 when something does. Exit 2 when the path or the flags are wrong.
PHP 8.1+ with the tokenizer extension, which PHP ships by default. The script tokenizes your config. It does not include it, so a dd() in config/auth.php does not run.
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
- name: tokengate
run: php tokengate.php --fail-on=high
Or, without adding the file to the app:
- name: tokengate
run: |
curl -fsSL -o /tmp/tokengate.php \
https://raw.githubusercontent.com/Nguemoue/project2026_20261030_tokengate/main/tokengate.php
php /tmp/tokengate.php .
php tokengate.php --self-test is the check for this repository, and it exits 0. Point the scanner at examples/exposed-12 when you want to see a failure.
Copy the file. That is the supported install.
curl -fsSL -o tokengate.php \
https://raw.githubusercontent.com/Nguemoue/project2026_20261030_tokengate/main/tokengate.php
composer.json is included so you can point a path repository at this git URL. The package is not required to be on Packagist.
composer audit, and not a scan of the whole lockfile. One CVE, one class.config/auth.php and bootstrap/cache/config.php are what get read.'hash' => true) still goes through TokenGuard, so it is still in scope.Le correctif est dans le code depuis le 25 août 2026 (Laravel 12.68.0 et 13.29.0). L'avis public est du 19 octobre. Entre les deux, beaucoup d'applications n'ont pas bougé : le tag dans composer.lock n'a pas changé, et le driver token dort encore dans config/auth.php depuis l'époque d'avant Sanctum.
Tu es concerné si les trois sont vrais :