Unprotected Transport of Credentials Affecting oauth2 package, versions >=0.4.0, <2.0.22


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUBY-OAUTH2-17275796
  • published10 Jun 2026
  • disclosed6 Jun 2026
  • credittonghuaroot

Introduced: 6 Jun 2026

New CVE NOT AVAILABLE CWE-523  (opens in a new tab)

How to fix?

Upgrade oauth2 to version 2.0.22 or higher.

Overview

Affected versions of this package are vulnerable to Unprotected Transport of Credentials in the request() function in client.rb, which exposes the Authorization: Bearer value. An attacker in control of a malicious endpoint that is the target of redirects can supply a Location header in a redirect response that uses a protocol-relative URI (starting with //), to obtain the authorization token when a user sends a request. This is caused by an unprotected URI#merge() operation.

CVSS Base Scores

version 4.0
version 3.1