Vulnerability GHSA-vfxr-r8f8-gfmp

Medium Risk
MEDIUM RISK
CVSS Score: 6.8
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
20 hours ago
December 03, 2026 at 06:08 PM UTC
Laravel: Sanctum guard can resolve the lowest-ID user when evaluated inside an eager-loaded Eloquent relation definition
4.0.0-BETA2 - 12.72.0
4.0.0-BETA2 - 12.72.0

Summary

Laravel: Sanctum guard can resolve the lowest-ID user when evaluated inside an eager-loaded Eloquent relation definition

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.

Impacted packages

Timeline

Published
20 hours ago
December 03, 2026 at 06:08 PM UTC
Fixed (12.73.0)
17 days ago
November 17, 2026 at 02:54 PM UTC
Last Modified
20 hours ago
December 03, 2026 at 06:15 PM UTC