Impact
The vulnerability arises when OAuthLib's client_credentials and Resource Owner Password Credentials grant handlers authenticate the request.client as a confidential client but retain an attacker‑supplied request.client_id for validation functions. This causes grant type and scope checks to be performed against the attacker‑supplied client_id rather than the authenticated client. The result is that an attacker can obtain tokens with grants or scopes belonging to a different, higher‑privilege client, effectively bypassing authorization. The weakness is a permission‑or‑role‑escalation logic flaw (CWE‑863).
Affected Systems
The affected product is the OAuthLib Python library (oauthlib:oauthlib). All releases before version 4.0.0 are vulnerable, including every deployment that installs versions 3.x and earlier in a Python 3.6+ environment. The flaw exists specifically in the client_credentials and Resource Owner Password Credentials grant handlers.
Risk and Exploitability
The CVSS score of 8.4 indicates a high severity. No EPSS score is publicly available, and the issue is not listed in the CISA KEV catalog, so the likelihood of observed exploitation is unknown. Attackers would need to control or influence the token request flow, supplying a client_id that differs from the authenticated client while using client_credentials or Resource Owner Password Grants. Once that occurs, the library will issue a token with the attacker‑supplied client’s identity and scopes, potentially granting access to protected resources. The flaw is exploitable in environments where application validators rely on the request.client_id field and have not otherwise reconciled it with the authenticated client.
OpenCVE Enrichment