OAuthLib CVE-2026-49272
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessDiscover valid device-enabled client ID
-
DeliverySend token request with bogus device_code
-
ExploitBypass missing device_code validation
-
ExecutionReceive bearer token for client
-
ImpactAccess protected resources as client
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Authentication mechanism validation
MITRE ATT&CK
2 techniques across 2 tactics: Defense Evasion, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The target must use oauthlib's RFC 8628 DeviceCodeGrant at its token endpoint (oauthlib 3.3.0 through pre-4.0.0). The attacker must know a valid client_id that is registered and enabled for the device_code grant; no valid device_code is needed because it is not validated. The advisory's PoC additionally requires the integrator's RequestValidator.authenticate_client to return success for public clients (set grant_type to urn:ietf:params:oauth:grant-type:device_code and client_type 'public'), which is linked to the separate oauthlib issue #919. Limiting factors: deployments not using the device code workflow are unaffected; exploitation realistically depends on the public-client authentication behavior described above and on the attacker obtaining a valid device-enabled client ID; the only complete fix per the vendor is upgrading to 4.0.0. |
| Impact | The vendor-assigned CVSS is 8.5 (High) with vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N, reflecting a network-reachable authentication bypass that yields a bearer token. However, the real-world risk is narrower than the raw score suggests and depends heavily on how the library is integrated. The vulnerability (CWE-287) is confirmed by the vendor advisory GHSA-3jp2-3mrg-2vxc: DeviceCodeGrant.validate_token_request performs no validation of the device_code parameter, so a caller who knows a valid client ID enabled for the device workflow can mint a token with a bogus device_code. No EPSS score was provided and the CVE is not listed in CISA KEV, so there is no evidence of active or widespread exploitation; the vuln.today decision label is 'this_week' (not act_now/emergency), consistent with a patch-this-cycle priority rather than a fire drill. A detailed public PoC is documented in the advisory, but the input does not confirm it as working exploit code. A key nuance: the advisory's PoC only reaches the vulnerable path when the integrator's authenticate_client implementation accepts public clients (tied to the separate oauthlib issue #919), so the input's AC:L/PR:L rating understates a real configuration dependency - exploitation is realistic but conditioned on specific integrator behavior rather than a default remote-unauthenticated break. Treat as a genuine priority for any deployment using the RFC 8628 device workflow on oauthlib 3.3.0-3.x, while recognizing the dependency makes it closer to a targeted than a mass-exploitable issue. |
| Exploit ScenarioDerived | An attacker who learns a valid client ID that is enabled for the device code workflow sends a token-endpoint request using grant_type urn:ietf:params:oauth:grant-type:device_code and an arbitrary device_code value; because the device_code is never validated, the server returns a valid bearer token for that client, which the attacker then uses to access protected resources as the impersonated client. A detailed PoC walkthrough is published in the vendor advisory, though the input does not confirm it as verified working exploit code. The CVSS AC:L/PR:L rating reflects network reachability, but the advisory's reproduction requires the integrator's authenticate_client to accept public clients. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 28, 2026
Improper authentication in OAuthLib's RFC 8628 device authorization grant allows a remote caller to obtain a bearer token without ever presenting a valid device_code. The token endpoint accepts any value (or none) in the device_code parameter because DeviceCodeGrant.validate_token_request performs no validation of it, so anyone who knows a client_id registered for the device_code grant can mint a token for that client. Affected are Python projects using oauthlib 3.3.0 through pre-4.0.0 that expose the device workflow at their token endpoint; the vendor-released fix is 4.0.0. No public exploit tooling or active exploitation is confirmed, and the advisory's reproduction scenario additionally depends on the integrator's RequestValidator.authenticate_client accepting public clients, a behavior tied to separate oauthlib issue #919.
RemediationAI
Vendor-released patch: upgrade oauthlib to 4.0.0, which reorganizes client authentication across grants so that grant_type is validated before client authentication (PR #920) and is the only complete fix per the vendor; see https://github.com/oauthlib/oauthlib/security/advisories/GHSA-3jp2-3mrg-2vxc and https://github.com/oauthlib/oauthlib/releases/tag/v4.0.0. Because 4.0.0 is a major release with two documented breaking changes - JSONP support removed from the token revocation endpoint (#951) and grant_type now validated before client authentication (#919, #920) - test token, revocation, and public-client flows before and after the upgrade, since clients relying on JSONP revocation responses or on the previous authentication ordering will break. If the upgrade cannot be staged immediately, the exposure is limited to services that actually serve the device_code grant: removing urn:ietf:params:oauth:grant-type:device_code from the grant types your token endpoint advertises and rejects eliminates the bypass path but disables device-flow login entirely; alternatively, the advisory's proposal of adding a validate_device_code hook to RequestValidator can be emulated in application code by rejecting token requests whose device_code does not match a pending, user-approved record before delegating to oauthlib's grant handler, which requires custom code and carries the risk of diverging from upstream behavior.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
OAuthLib is a Python OAuth 1/2 framework whose server-side token endpoint dispatches to per-grant handler classes under oauthlib/oauth2/rfc6749/grant_types. The device grant (DeviceCodeGrant) implements RFC 8628, the Device Authorization Grant used by input-constrained devices: the client first requests a device_code and user_code, the user approves out-of-band, and the client then polls the token endpoint with grant_type=urn:ietf:params:oauth:grant-type:device_code plus the device_code. RFC 8628 section 3.4 makes device_code a required parameter of that token request. DeviceCodeGrant.validate_token_request omits the parameter presence and validity checks that AuthorizationCodeGrant.validate_token_request performs for the authorization code, and the framework likewise never calls a validator hook for the device code. This is CWE-287 (Improper Authentication): the grant handler treats the request as authenticated on the strength of grant_type and client identification alone, without proving the device_code corresponds to a pending, user-approved authorization. The advisory proposes adding a validate_device_code method to RequestValidator, mirroring validate_code, and invoking it from DeviceCodeGrant.validate_token_request. The reproduction depends on RequestValidator.authenticate_client granting success to public clients (client_type 'public'), which the reporter links to issue #919; release 4.0.0 reorganizes client authentication across grants and validates grant_type before client authentication (PR #920), and also removes JSONP support from the token revocation endpoint as a second breaking change.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:H/A:N
Knowing a client ID is not a secret so PR:N, but reaching the path depends on integrator public-client handling (#919) so AC:H; token issuance crosses to resource server giving S:C and high integrity impact.
Primary rating from GitHub Advisory.
CVSS VectorGitHub Advisory
DescriptionGitHub Advisory
Summary
A call to the token endpoint with a grant type of "urn:ietf:params:oauth:grant-type:device_code" and a bogus device_code is able to get a bearer token as long as they know a valid client ID enabled for the device workflow.
Details
Section 3.4 of the RFC 8628 spec says that the token endpoint should take in device_code as a required parameter.DeviceCodeGrant.validate_token_request does not perform any validation of device_code. DeviceCodeGrant.validate_token_request should be validating that device_code was passed in as a parameter and that it is valid, similar to how AuthorizationCodeGrant.validate_token_request does the checks here and here.
I would like to propose a new method be added to RequestValidator called validate_device_code that is similar to the validate_code method and is called inside of DeviceCodeGrant.validate_token_request.
PoC
Create an implementation of RequestValidation.authenticate_client that returns True if the client's client_type is "public". You would find yourself in this scenario because there's another issue with DeviceCodeGrant.validate_token_request where it doesn't properly handle public clients (see https://github.com/oauthlib/oauthlib/issues/919).
Create a client that has a client_type of "public" and set it's grant_type to "urn:ietf:params:oauth:grant-type:device_code".
With this implementation of RequestValidation.authenticate_client done, use that validator for your token endpoint. Call the token endpoint with a body of
{
"client_id": <ID of the public client you made>,
"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
"device_code": <anything you want since it's not validated>
}You now have a bearer token for the client without a valid device_code.
Impact
Anyone using the RFC 8628 device workflow in oauthlib that doesn't realize the device_code parameter is not being validated.
Technical POC Analysis
CWE-287 (Improper Authentication).
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
A high-severity authentication bypass in OAuthLib's device authorization grant (CVE-2026-49272) could enable unauthorized token issuance for OAuth clients, undermining the trust model of authentication-dependent services. Leadership should prioritize remediation because affected Python applications that expose the device workflow may allow attackers to bypass device-code validation and gain unauthorized access to protected resources.
No vendor-released patch identified at time of analysis; interim mitigations include disabling the device_code grant if not required, restricting token endpoint access to trusted networks, and ensuring RequestValidator.authenticate_client does not accept public clients (per oauthlib issue #919).
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
GHSA-3jp2-3mrg-2vxc
NVD
CVE.org
Exploit-DB