CVE-2026-142636: Laravel Sanctum Guard Can Resolve The Vulnerability

MODERATE
Advisory Identifier: GHSA-vfxr-r8f8-gfmp
CVSS 6.8
CWE-863
Published
Advisory Summary

CVE-2026-142636 is a MODERATE (CVSS 6.8) sanctum guard can resolve the vulnerability (CWE-863: Incorrect Authorization) affecting Laravel libraries in the Packagist ecosystem. The issue involves sanctum guard can resolve the lowest-id user when evaluated inside an eager-loaded eloquent relation definition. Remediation is available by upgrading affected packages to version 12.73.0.

CVE-2026-142636 at a Glance

CVE Identifier CVE-2026-142636
GHSA Identifier GHSA-vfxr-r8f8-gfmp
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-863: Incorrect Authorization
Affected Product Laravel
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-142636

To remediate this vulnerability, upgrade all affected Laravel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

laravel/framework fixed: 12.73.0
Upgrade laravel/framework to 12.73.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for laravel/framework

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-142636, inspect your project dependencies for Laravel:

inspect dependencies for laravel/framework

Analyze the terminal output to locate any version of Laravel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 12.73.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Laravel, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2026-142636 Affected Laravel Versions

1 component(s)
Fixed Versions:
12.73.0
Product / Package Ecosystem Affected Versions Fixed Version
laravel/framework
Packagist
< 12.73.0
12.73.0

References

Frequently Asked Questions

What is CVE-2026-142636?
CVE-2026-142636 is a security vulnerability in Laravel involving Sanctum guard can resolve the lowest-ID user when evaluated inside an eager-loaded Eloquent relation definition under CWE-863: Incorrect Authorization.
Which Laravel versions are affected?
Affected versions include releases prior to 12.73.0 across affected packages: laravel/framework.
What version fixes CVE-2026-142636?
Upgrading to 12.73.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is laravel/framework affected?
Yes, laravel/framework is affected in releases prior to 12.73.0. Upgrade your dependency to 12.73.0 or later.
What is the CVSS score of CVE-2026-142636?
CVE-2026-142636 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-142636?
CVE-2026-142636 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Packagist dependencies for CVE-2026-142636?
Run the dependency tree command: 'inspect dependencies for laravel/framework'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-vfxr-r8f8-gfmp",
  "modified" : "2026-12-03T18:08:59Z",
  "published" : "2026-12-03T18:08:58Z",
  "aliases" : [ "CVE-2026-142636" ],
  "summary" : "Laravel: Sanctum guard can resolve the lowest-ID user when evaluated inside an eager-loaded Eloquent relation definition",
  "details" : "### Impact\n\nWhen 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.\n\n### Patches\n\nThe 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.\n\n### Workarounds\n\nAvoid resolving the authenticated user inside relation definitions. Resolve the user ID beforehand and pass it explicitly through an eager-load constraint closure.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "laravel/framework"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "12.73.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/laravel/framework/security/advisories/GHSA-vfxr-r8f8-gfmp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-142636"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/laravel/framework/pull/62483"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/laravel/framework/commit/6ea0fda8128e36e912e7fde755dac345bde9f5f7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/laravel/framework"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/laravel/framework/releases/tag/v12.73.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-03T18:08:58Z",
    "nvd_published_at" : "2026-12-02T23:18:42Z"
  }
}