CVE-2026-39976
JSON

7.1high

Laravel Passport's TokenGuard Authenticates Unrelated User for Client Credentials Tokens

Severity
7.1high CVSS:3.1 by GitHub_M
Exploit likelihood
0.30% (higher than 24% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-349c-2h2f-mxf6

Description

Laravel Passport provides OAuth2 server support to Laravel. From 13.0.0 to before 13.7.1, there is an Authentication Bypass for client_credentials tokens. the league/oauth2-server library sets the JWT sub claim to the client identifier (since there's no user). The token guard then passes this value to retrieveById() without validating it's actually a user identifier, potentially resolving an unrelated real user. Any machine-to-machine token can inadvertently authenticate as an actual user. This vulnerability is fixed in 13.7.1.

Affected

Product or packageVersionsReported by
laravel passport>= 13.0.0, < 13.7.1, from 13.0.0 before 13.7.1CVE List, NVD
laravel/passport (Packagist)from 13.0.0 before 13.7.1GitHub Advisory Database

All scores

GitHub_M7.1high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N
GitHub7.1high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N

Classification

CWE-287

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Laravel Passport provides OAuth2 server support to Laravel. From 13.0.0 to before 13.7.1, there is an Authentication Bypass for client_credentials tokens. the league/oauth2-server library sets the JWT sub claim to the client identifier (since there's no user). The token guard then passes this value to retrieveById() without validating it's actually a user identifier, potentially resolving an unrelated real user. Any machine-to-machine token can inadvertently authenticate as an actual user. This vulnerability is fixed in 13.7.1.

GitHub Advisory Database
Impact

Authentication Bypass for client_credentials tokens. the league/oauth2-server library sets the JWT sub claim to the client identifier (since there's no user). The token guard then passes this value to retrieveById() without validating it's actually a user identifier, potentially resolving an unrelated real user. Any machine-to-machine token can inadvertently authenticate as an actual user.

Usage of EnsureClientIsResourceOwner middleware together with Passport::$clientUuids set to false, can result in resolving the user instead, as stated in the documentation.

The underlying OAuth2 server sets the token's sub claim to the client's identifier for client credentials tokens. By default, Passport uses UUIDs for clients, so this cannot collide with a user's integer primary key. However, if you have set Passport::$clientUuids to false, a client credentials token may inadvertently resolve a user whose ID matches the client's ID. In such cases, using this middleware cannot guarantee that the incoming token is a client credentials token.

Patches

Patched in v13.7.1

Workarounds

Is there a way for users to fix or remediate the vulnerability without upgrading? Disallow usage of client_credentials.

References
NVD (es)

Laravel Passport proporciona soporte de servidor OAuth2 a Laravel. Desde la 13.0.0 hasta antes de la 13.7.1, existe una omisión de autenticación para los tokens de client_credentials. La biblioteca league/oauth2-server establece la declaración sub de JWT al identificador del cliente (ya que no hay usuario). El token guard luego pasa este valor a retrieveById() sin validar que es realmente un identificador de usuario, resolviendo potencialmente un usuario real no relacionado. Cualquier token de máquina a máquina puede autenticarse inadvertidamente como un usuario real. Esta vulnerabilidad está corregida en la 13.7.1.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-39976 changed 2026-04-09CVE Terms of Use
GitHub Advisory DatabaseGHSA-349c-2h2f-mxf6 changed 2026-04-13CC-BY-4.0
NVDCVE-2026-39976 changed 2026-10-26Public domain