Laravel: Sanctum guard can resolve the lowest-ID user when evaluated inside an eager-loaded Eloquent relation definition
Published 3 Dec 2026 · Updated 3 Dec 2026
Affected package
- Affected
- <12.73.0
- Fixed in
- 12.73.0
composer require laravel/framework:^12.73.0Which laravel/framework does your project really install?
Works for private projects: the file is read in memory to run the scan and then dropped. Also reads composer.json.
Public repo?
Look after several Laravel or PHP apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Details
Impact
When an authenticated user is first resolved while Eloquent is initializing an eager-loaded relation, Eloquent's relation constraints are temporarily disabled. A lazy key-constrained lookup made during that window, such as Sanctum's token owner lookup, runs without its key restriction. The guard can then return the lowest-ID user (often an administrator) instead of the token's owner. This affects applications that call the guard inside a relation definition used with eager loading, for example in optional-authentication routes. A low-privilege token could then read that user's data, and the wrong user remains cached for the rest of the request. Routes where authentication middleware resolves the user first were not affected in testing.
Patches
The fix for the 12.x branch has been merged in https://github.com/laravel/framework/pull/62483, which keeps constraints enabled when nested relation attributes are resolved during eager-load relation initialization.
Workarounds
Avoid resolving the authenticated user inside relation definitions. Resolve the user ID beforehand and pass it explicitly through an eager-load constraint closure.
Is GHSA-vfxr-r8f8-gfmp in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected laravel/framework, and gives you the command that fixes it.
More advisories for laravel/framework
- HighCVE-2026-142610Laravel: Numeric validation can exhaust resources via extreme exponent input · 4 Dec 2026
- LowCVE-2026-142622Laravel: Cross-Origin Auth Token Leakage Through Broadcasting JSONP Callback · 3 Dec 2026
- MediumCVE-2026-142637Laravel: Fluent Rule::exists() and Rule::unique() where() values can be interpreted as reserved predicates instead of literal values · 3 Dec 2026
- MediumCVE-2026-142644Laravel: Quadratic regex backtracking in the decimal validation rule can cause denial of service · 3 Dec 2026
- MediumCVE-2026-142649Laravel: `in` / `Rule::in` validation rule bypass via loose comparison · 3 Dec 2026
- MediumCVE-2026-142643Laravel: Validation exists rule can be bypassed with integer or boolean input on MySQL/MariaDB · 3 Dec 2026
References
- Linkgithub.com/laravel/framework/security/advisories/GHSA-vfxr-r8f8-gfmp
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-142636
- Linkgithub.com/laravel/framework/pull/62483
- Linkgithub.com/laravel/framework/commit/6ea0fda8128e36e912e7fde755dac345bde9f5f7
- Packagegithub.com/laravel/framework
- Linkgithub.com/laravel/framework/releases/tag/v12.73.0
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.