All vulnerabilities

Servers and applications

GHSA-vfxr-r8f8-gfmp

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

Severity
Medium 6.8
Published
18 Nov 2026
Last changed
18 Nov 2026
Added to UpHeron
18 Nov 2026
Fixed in
12.73.0
Weakness
Incorrect authorization (CWE-863)
Attack
Over the network · Only under certain conditions · Needs a user account · No user action needed
Attacker can
Read data · Change data
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
Sources
Project advisories (GitHub)

Description

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.

From laravel/framework's security advisory.

Workarounds

Avoid resolving the authenticated user inside relation definitions. Resolve the user ID beforehand and pass it explicitly through an eager-load constraint closure.

Workarounds as given by laravel/framework's security advisory.

Affected software

SoftwareAffected versions
LaravelServers and applications · github:laravel/framework
  • Every version before 12.73.0

About Laravel

open source web application framework, written in PHP

From Wikidata, CC0 1.0.
Developers who used it in the past year
8.9%Stack Overflow Developer Survey 2025, 2025
Monthly downloads (Packagist)
24,524,463Packagist, 15 Nov 2026
Total downloads (Packagist)
622,287,963Packagist, 15 Nov 2026
GitHub stars
35,000GitHub, 15 Nov 2026
Forks
12,030GitHub, 15 Nov 2026
Latest release
v13.42.0GitHub, 15 Nov 2026
Released
10 Nov 2026GitHub
Developer
Taylor OtwellWikidata
License
MIT LicenseWikidata
Written in
PHPWikidata
First released
9 Jun 2011Wikidata
First published on GitHub
10 Jan 2013GitHub

Release lines

ReleaseLatestSecurity fixes
1313.42.0Until 17 Mar 2028
1212.72.0Until 24 Feb 2027
1111.57.1Ended 12 Mar 2026
1010.50.4Ended 4 Feb 2025
99.52.23Ended 6 Feb 2024
88.83.29Ended 24 Jan 2023

From endoflife.date.

References