Laravel Passport client_credentials authentication bypass can impersonate unrelated users

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2026-39976?

CVE-2026-39976 is a vulnerability classified as Improper Authentication, affecting passport (affected versions: >= 13.0.0, < 13.7.1). This vulnerability is rated High, with a CVSS score of 7.1. Public exploit code or evidence is available for this vulnerability, but that does not confirm exploitation in the wild.

Overview

Original source data

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 products and scope

  • Laravel Passport from vendor Laravel is affected in the range >= 13.0.0, < 13.7.1.
  • The vendor advisory identifies 13.7.1 as the patched version.
  • The documented exposure concerns client_credentials token handling, with a highlighted configuration involving Passport::$clientUuids = false and matching client and user IDs.
  • A post-patch repository issue reports that deployments using integer IDs and an absent or null grant_types column can experience an HTTP 401 regression during refresh_token processing; a follow-up pull request updated the migration guidance for that configuration.
  • The supplied evidence does not establish the status of product branches outside the range above.

Technical details

Laravel Passport processes OAuth2 client_credentials tokens through TokenGuard. When no user exists, league/oauth2-server places the client identifier in the JWT sub claim, and bearer-token validation exposes that value as oauth_user_id. TokenGuard then passes the value to retrieveById() without validating that it is a user identifier, so the configured provider may resolve an unrelated user. The vendor advisory identifies a direct collision case when Passport::$clientUuids is false and the client ID matches a user ID. A repository issue also documents a MySQL type-coercion path in which a UUID client identifier can be converted during lookup against an integer user primary key. Reachability therefore depends on the key types, database behavior, and user-provider implementation; behavior outside the documented configurations is not established.

Exploitability

The flaw is reachable through the OAuth2 flow and use of client_credentials bearer tokens over the network. The supplied record indicates that the attacker needs suitable client access or credentials; practical complexity depends on creating an identifier collision or triggering database type coercion. No user interaction is required, but the token must pass through the application's bearer-token guard and meet the relevant configuration conditions. The supplied record marks a public exploit as available, but it does not name a specific exploit, campaign, victim, or confirmed abuse. The reviewed technical sources describe the code path and reproducible conditions, not an active exploitation campaign.

Technical impact

  • The primary technical outcome is an authentication-boundary failure between an OAuth client and a user: a token with no associated user may resolve to a real user.
  • Possible consequences include unauthorized access to the user's data and actions that the user is allowed to perform. The exact operation set depends on application authorization.
  • The effect may cross from token handling into resources protected by the resolved user context, but the available record does not establish a particular endpoint or policy that is always affected.
  • The evidence does not show a direct availability impact. Confidentiality and integrity exposure should be assessed according to which users can be resolved and what permissions they hold.

Business impact

A credential intended for machine-to-machine communication may be assigned a user context instead of representing only the OAuth client. If the application authorizes the resulting request as that user, an attacker may read data available to the user and may perform actions permitted to that identity. Audit records can also attribute client activity to the wrong user, weakening accountability and incident reconstruction. The actual data and operations at risk depend on application authorization; the record does not establish a specific compromise or data loss event.

Remediation

  1. Upgrade Laravel Passport to the exact patched release identified by the vendor advisory: 13.7.1. Do not assume that other parallel branches or releases are covered unless the vendor confirms them.
  2. If an upgrade is not immediately possible, apply the vendor workaround of disabling use of the client_credentials grant. This is a mitigation, not a substitute for the patch.
  3. For deployments using integer client IDs, review the grant_types migration after updating to 13.7.1. Maintainer follow-up states that an absent or null column can cause a token-processing regression, and a subsequent merged change clarified the migration requirement for integer-ID configurations.
  4. Test both client_credentials and user-associated flows such as password or refresh_token, especially where client and user IDs can be equal. Confirm that a client token produces no user context and that valid user tokens are not rejected unexpectedly.
  5. Review requests and permissions processed while an affected release was deployed. If a machine-to-machine token was resolved as a user, revoke or rotate the relevant credential and investigate activity recorded under that user identity.

Detection

  1. Inventory the Composer package and determine the deployed Laravel Passport version.
  2. Identify applications that issue or accept the client_credentials grant, then review how bearer requests are mapped to request->user() or Auth::guard('api')->user().
  3. Check Passport::$clientUuids, the primary-key types for user and oauth_clients records, and database coercion behavior. Look specifically for client identifiers that can collide with or be converted into user identifiers.
  4. In a non-production test environment, verify that a client_credentials token does not resolve to a user and does not receive that user's authorization context.
  5. For patched deployments using integer client IDs, verify the presence and state of the grant_types column. The follow-up issue reports that an absent or null column can cause a regression in which some refresh_token requests receive HTTP 401 responses.
  6. As a precaution, monitor for requests using client_credentials tokens that nevertheless create a user context or access data under a user identity. Treat this as an investigation lead, not as a confirmed indicator of compromise.
Sources (22)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.