Advisory Database
  • Advisories
  • Dependency Scanning
  1. gem
  2. ›
  3. oauth2
  4. ›
  5. CVE-2026-54603

CVE-2026-54603: OAuth2::Client#request: Protocol-relative redirect Location overrides authority, leaking bearer Authorization to attacker host

July 28, 2026

When an application uses OAuth2::Client (typically via an OAuth2::AccessToken) and the configured authorization server returns a redirect whose Location header is a protocol-relative URI of the form //attacker.example/leak, OAuth2::Client#request resolves the redirect with response.response.env.url.merge(location). Per RFC 3986 §5.2, an input that starts with // is a network-path reference and replaces the authority of the base URL: URI("http://idp.trusted/userinfo").merge("//attacker.example/leak") returns http://attacker.example/leak. The recursive request(verb, full_location, req_opts) call then re-sends the request to the attacker host while preserving the Authorization: Bearer <access-token> header that OAuth2::AccessToken#configure_authentication! installed on req_opts[:headers] for the original request.

The result is a one-shot cross-origin credential disclosure: any 30x response from the IdP that an attacker can influence (a compromised endpoint, a tenant-controlled IdP in a multi-tenant deployment, or an open-redirect handler that does not normalise the Location it emits) can extract the bearer access token of the calling user.

References

  • github.com/advisories/GHSA-pp92-crg2-gfv9
  • github.com/ruby-oauth/oauth2/commit/0f0a474f1b38453e119e660c2daca742d4378ce9
  • github.com/ruby-oauth/oauth2/releases/tag/v2.0.22
  • github.com/ruby-oauth/oauth2/security/advisories/GHSA-pp92-crg2-gfv9
  • nvd.nist.gov/vuln/detail/CVE-2026-54603

Code Behaviors & Features

Detect and mitigate CVE-2026-54603 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.4.0 before 2.0.22

Fixed versions

  • 2.0.22

Solution

Upgrade to version 2.0.22 or above.

Impact 8.6 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
  • CWE-601: URL Redirection to Untrusted Site ('Open Redirect')

Source file

gem/oauth2/CVE-2026-54603.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:17:00 +0000.