Laravel Passport: TokenGuard Authenticates Unrelated User for Client Credentials Tokens
Published 8 Apr 2026 · Updated 13 Apr 2026
Affected package
- Affected
- >=13.0.0 <13.7.1
- Fixed in
- 13.7.1
composer require laravel/passport:^13.7.1Details
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
- https://github.com/laravel/passport/issues/1900
- https://github.com/laravel/passport/pull/1901
- https://github.com/laravel/passport/pull/1902
- https://github.com/thephpleague/oauth2-server/issues/1456#issuecomment-2734989996
Is GHSA-349c-2h2f-mxf6 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/passport, and gives you the command that fixes it.
References
- Linkgithub.com/laravel/passport/security/advisories/GHSA-349c-2h2f-mxf6
- Advisorynvd.nist.gov/vuln/detail/CVE-2026-39976
- Linkgithub.com/laravel/passport/issues/1900
- Linkgithub.com/thephpleague/oauth2-server/issues/1456#issuecomment-2734989996
- Linkgithub.com/laravel/passport/pull/1901
- Linkgithub.com/laravel/passport/pull/1902
- Packagegithub.com/laravel/passport
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.