oauth2 is vulnerable to Exposure of Sensitive Information
86
CVE Score
High
Exposure of Sensitive Information
The OAuth2::Client#request method resolves HTTP 30x redirect Location headers with URI#merge and re-issues the request without revalidating the target host or pruning credentials. A protocol-relative location such as //attacker.example/leak is treated as a network-path reference that replaces the original authority, so the follow-up request is sent to an attacker-controlled host while still carrying the Authorization: Bearer header configured for the trusted identity provider. This discloses the bearer token cross-origin with no user interaction, exploitable via IdP open redirects, hostile multi-tenant configurations, or a network-position attacker rewriting response headers. The fix neutralizes protocol-relative locations before merging and strips Authorization headers when a redirect changes scheme, host, or port.
Upgrade the oauth2 library to the patch version.
You are affected if you are using a version that falls within the vulnerable range.
0.4.0 - 2.0.21
Fixed in 2.0.22oauth2 is vulnerable to Exposure of Sensitive Information in versions 0.4.0 - 2.0.21.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.