CVE-2026-54605: OAuth Cross-origin Token-request Redirects Can Expose Vulnerability

HIGH
Advisory Identifier: GHSA-prq8-7wvh-44qh
CVSS 7.2
CWE-918 CWE-200 CWE-346
Published
Advisory Summary

CVE-2026-54605 is a HIGH (CVSS 7.2) cross-origin token-request redirects can expose vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting OAuth libraries in the RubyGems ecosystem. The issue involves cross-origin token-request redirects can expose signed request metadata. Remediation is available by upgrading affected packages to version 1.1.6.

CVE-2026-54605 at a Glance

CVE Identifier CVE-2026-54605
GHSA Identifier GHSA-prq8-7wvh-44qh
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product OAuth
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-54605

To remediate this vulnerability, upgrade all affected OAuth dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

oauth fixed: 1.1.6
Upgrade oauth to 1.1.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for oauth

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-54605, inspect your project dependencies for OAuth:

inspect dependencies for oauth

Analyze the terminal output to locate any version of OAuth in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.6), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In OAuth, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

# Cross-origin OAuth token-request redirects can expose signed request metadata ## Summary When an application uses `OAuth::Consumer` to request OAuth 1.0 request tokens or access tokens, the token request helper follows `300..399` redirects returned by the OAuth server. In affected versions, `OAuth::Consumer#token_request` parses the raw `Location` header, follows the redirect recursively, and can mutate the consumer's configured `site` when the redirect points to a different host with the same path. The result is a cross-origin signed-request disclosure primitive: if an OAuth server token endpoint returns a redirect whose target an attacker controls, the client can re-sign the token request and send OAuth 1.0 request metadata, including the OAuth signature, nonce, timestamp, consumer key, and any request parameters included in the signature base string, to the attacker-controlled host. The same behavior can also be used as an SSRF or confused-deputy primitive because the application server follows the redirect and sends the next request from its own network position. ## Affected - `oauth` v1.1.5 and prior versions back to and including v0.5.5. - The cross-host token redirect behavior was introduced by https://github.com/ruby-oauth/oauth/commit/d74b767f - The behavior is documented in the v0.5.5 changelog as "Allow redirect to different host but same path". - The vulnerable behavior is in `OAuth::Consumer#token_request`, which is used by the documented request-token and access-token flows. - The issue is not specific to a Ruby engine or platform. It is caused by the gem's redirect handling and recursive token request behavior. Patched version: `oauth` v1.1.6. ## Impact A consumer that calls `OAuth::Consumer#get_request_token`, `OAuth::Consumer#get_access_token`, or lower-level token request helpers against an OAuth server whose token endpoint redirect target can be influenced may lose three security properties: 1. **Cross-origin signed-request metadata disclosure.** The redirected request is signed for the attacker-controlled endpoint. Depending on the request method, scheme, and parameters, the attacker may receive OAuth 1.0 parameters such as `oauth_consumer_key`, `oauth_signature_method`, `oauth_timestamp`, `oauth_nonce`, `oauth_version`, and `oauth_signature`. 2. **SSRF from the application server.** The OAuth client follows the redirect on behalf of the application, so the redirected host is contacted from the application server's network position. 3. **Confused-deputy behavior.** A malicious or compromised token endpoint can cause an otherwise trusted application to initiate signed requests to an unintended origin. The disclosed OAuth 1 signature is not equivalent to an OAuth 2 bearer token: it is bound to the signed request, timestamp, nonce, HTTP method, and request URL. However, it can still disclose sensitive integration metadata, may be replayable within the receiver's accepted nonce/timestamp window in some deployments, and can expose application-server reachability to attacker-selected hosts. ## Vulnerable code [`lib/oauth/consumer.rb`](https://github.com/ruby-oauth/oauth/blob/v1.1.5/lib/oauth/consumer.rb) at tag `v1.1.5`: ```ruby def token_request(http_method, path, token = nil, request_options = {}, *arguments) request_options[:token_request] ||= true response = request(http_method, path, token, request_options, *arguments) case response.code.to_i when (200..299) # parse token response when (300..399) # Parse redirect to follow uri = URI.parse(response["location"]) our_uri = URI.parse(site) # Guard against infinite redirects response.error! if uri.path == path && our_uri.host == uri.host if uri.path == path && our_uri.host != uri.host options[:site] = "#{uri.scheme}://#{uri.host}" @http = create_http end token_request(http_method, uri.path, token, request_options, arguments) when (400..499) raise OAuth::Unauthorized, response else response.error! end end ``` The vulnerable behavior has several parts: - `response["location"]` is trusted as the next token request target. - Redirects are followed for every `300..399` response. - There is no general redirect counter or maximum redirect limit. - Cross-host redirects with the same path can mutate `options[:site]` and rebuild the underlying HTTP client. - The recursive call continues the token request flow and signs the next request for the redirected destination. ## Reachable in production The vulnerable path is reachable through the normal OAuth 1 token exchange: ```ruby consumer = OAuth::Consumer.new( consumer_key, consumer_secret, site: "https://provider.example" ) request_token = consumer.get_request_token ``` If `https://provider.example/oauth/request_token` returns a redirect to an attacker-controlled host, the library follows that redirect as part of the token request flow. A realistic trigger is an OAuth provider, gateway, or reverse proxy that emits `Location` based on user-controlled or tenant-controlled input, or a malicious tenant-controlled OAuth endpoint in a multi-tenant integration. No application-level redirect handling is required. The redirect is followed inside the gem before the application receives the token response. ## Reproduction A vulnerable application is one that uses `OAuth::Consumer` to perform an OAuth 1 token exchange against a token endpoint that can be made to return a redirect to another origin. Example shape: ```ruby consumer = OAuth::Consumer.new( consumer_key, consumer_secret, site: "https://provider.example" ) consumer.get_request_token ``` If `https://provider.example/oauth/request_token` responds with a `30x` redirect whose `Location` points to `https://attacker.example/...`, affected versions may follow that redirect as part of the token request flow. The redirected request is then generated and signed by the application server for the new destination. Depending on the configured OAuth request scheme, OAuth 1 parameters may be sent in the `Authorization` header, request body, or query string. Expected vulnerable behavior: - the token request leaves the configured OAuth provider origin; - the redirected host receives a signed OAuth 1 token request; - the application does not get a chance to inspect or approve the redirect target before the redirected request is sent. Expected patched behavior: - same-origin redirects continue to work, subject to a redirect limit; - cross-origin token endpoint redirects are rejected by default; - applications that intentionally require cross-origin token redirects must opt in explicitly with `token_request_cross_origin_redirects`. ## Suggested fix Reject cross-origin token endpoint redirects by default and require explicit opt-in for integrations that intentionally depend on that behavior. The fix released in v1.1.6 does the following: ```ruby current_uri = token_request_uri(path) redirected_uri = token_request_redirect_uri(current_uri, response) response.error! unless redirected_uri redirect_count = request_options[:token_request_redirect_count].to_i + 1 response.error! if redirect_count > token_request_max_redirects(request_options) response.error! if token_request_cross_origin?(current_uri, redirected_uri) && !token_request_cross_origin_redirects?(request_options) redirect_options = request_options.merge(token_request_redirect_count: redirect_count) token_request(http_method, token_request_redirect_path(current_uri, redirected_uri), token, redirect_options, *arguments, &block) ``` The fix intentionally preserves same-origin redirect compatibility while making cross-origin token endpoint redirects an explicit choice. It also avoids placing internal redirect state in `request_options` passed to OAuth signing. ## Workarounds Until a patched release is available, applications can reduce exposure by doing one or more of the following: - Ensure configured OAuth token endpoints are fixed absolute URLs controlled by a trusted provider. - Do not use tenant-controlled OAuth token endpoint URLs unless the tenant is trusted to receive signed OAuth token requests. - Block outbound application-server traffic to internal metadata services and other sensitive internal addresses at the network layer. - Place a trusted proxy in front of OAuth providers that rejects token endpoint redirects to a different origin. These mitigations reduce exploitability but do not remove the vulnerable redirect logic from the gem. ## Credit Found during the follow-up audit for `GHSA-pp92-crg2-gfv9`. Reporter/coordinator: Peter H. Boling (`pboling`). ## References - Related OAuth 2 advisory: https://github.com/ruby-oauth/oauth2/security/advisories/GHSA-pp92-crg2-gfv9 - Fixed version: `oauth` v1.1.6 - Behavior-introducing commit: https://github.com/ruby-oauth/oauth/commit/d74b767f

CVE-2026-54605 Affected OAuth Versions

1 component(s)
Fixed Versions:
1.1.6
Product / Package Ecosystem Affected Versions Fixed Version
oauth
RubyGems
≥ 0.5.5
< 1.1.6
1.1.6

References

Frequently Asked Questions

What is CVE-2026-54605?
CVE-2026-54605 is a security vulnerability in OAuth involving Cross-origin token-request redirects can expose signed request metadata under CWE-918: Server-Side Request Forgery (SSRF).
Which OAuth versions are affected?
Affected versions include releases prior to 1.1.6 across affected packages: oauth.
What version fixes CVE-2026-54605?
Upgrading to 1.1.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is oauth affected?
Yes, oauth is affected in releases prior to 1.1.6. Upgrade your dependency to 1.1.6 or later.
What is the CVSS score of CVE-2026-54605?
CVE-2026-54605 has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-54605?
CVE-2026-54605 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check RubyGems dependencies for CVE-2026-54605?
Run the dependency tree command: 'inspect dependencies for oauth'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-prq8-7wvh-44qh",
  "modified" : "2026-07-28T16:27:11Z",
  "published" : "2026-07-28T16:27:11Z",
  "aliases" : [ "CVE-2026-54605" ],
  "summary" : "OAuth: Cross-origin token-request redirects can expose signed request metadata",
  "details" : "# Cross-origin OAuth token-request redirects can expose signed request metadata\n\n## Summary\n\nWhen an application uses `OAuth::Consumer` to request OAuth 1.0 request tokens or\naccess tokens, the token request helper follows `300..399` redirects returned by\nthe OAuth server. In affected versions, `OAuth::Consumer#token_request` parses the\nraw `Location` header, follows the redirect recursively, and can mutate the\nconsumer's configured `site` when the redirect points to a different host with\nthe same path.\n\nThe result is a cross-origin signed-request disclosure primitive: if an OAuth\nserver token endpoint returns a redirect whose target an attacker controls, the\nclient can re-sign the token request and send OAuth 1.0 request metadata,\nincluding the OAuth signature, nonce, timestamp, consumer key, and any request\nparameters included in the signature base string, to the attacker-controlled\nhost. The same behavior can also be used as an SSRF or confused-deputy primitive\nbecause the application server follows the redirect and sends the next request\nfrom its own network position.\n\n## Affected\n\n- `oauth` v1.1.5 and prior versions back to and including v0.5.5.\n  - The cross-host token redirect behavior was introduced by\n    https://github.com/ruby-oauth/oauth/commit/d74b767f\n  - The behavior is documented in the v0.5.5 changelog as \"Allow redirect to\n    different host but same path\".\n- The vulnerable behavior is in `OAuth::Consumer#token_request`, which is used by\n  the documented request-token and access-token flows.\n- The issue is not specific to a Ruby engine or platform. It is caused by the\n  gem's redirect handling and recursive token request behavior.\n\nPatched version: `oauth` v1.1.6.\n\n## Impact\n\nA consumer that calls `OAuth::Consumer#get_request_token`,\n`OAuth::Consumer#get_access_token`, or lower-level token request helpers against\nan OAuth server whose token endpoint redirect target can be influenced may lose\nthree security properties:\n\n1. **Cross-origin signed-request metadata disclosure.** The redirected request is\n   signed for the attacker-controlled endpoint. Depending on the request method,\n   scheme, and parameters, the attacker may receive OAuth 1.0 parameters such as\n   `oauth_consumer_key`, `oauth_signature_method`, `oauth_timestamp`,\n   `oauth_nonce`, `oauth_version`, and `oauth_signature`.\n2. **SSRF from the application server.** The OAuth client follows the redirect on\n   behalf of the application, so the redirected host is contacted from the\n   application server's network position.\n3. **Confused-deputy behavior.** A malicious or compromised token endpoint can\n   cause an otherwise trusted application to initiate signed requests to an\n   unintended origin.\n\nThe disclosed OAuth 1 signature is not equivalent to an OAuth 2 bearer token: it\nis bound to the signed request, timestamp, nonce, HTTP method, and request URL.\nHowever, it can still disclose sensitive integration metadata, may be replayable\nwithin the receiver's accepted nonce/timestamp window in some deployments, and\ncan expose application-server reachability to attacker-selected hosts.\n\n## Vulnerable code\n\n[`lib/oauth/consumer.rb`](https://github.com/ruby-oauth/oauth/blob/v1.1.5/lib/oauth/consumer.rb)\nat tag `v1.1.5`:\n\n```ruby\ndef token_request(http_method, path, token = nil, request_options = {}, *arguments)\n  request_options[:token_request] ||= true\n  response = request(http_method, path, token, request_options, *arguments)\n  case response.code.to_i\n\n  when (200..299)\n    # parse token response\n  when (300..399)\n    # Parse redirect to follow\n    uri = URI.parse(response[\"location\"])\n    our_uri = URI.parse(site)\n\n    # Guard against infinite redirects\n    response.error! if uri.path == path && our_uri.host == uri.host\n\n    if uri.path == path && our_uri.host != uri.host\n      options[:site] = \"#{uri.scheme}://#{uri.host}\"\n      @http = create_http\n    end\n\n    token_request(http_method, uri.path, token, request_options, arguments)\n  when (400..499)\n    raise OAuth::Unauthorized, response\n  else\n    response.error!\n  end\nend\n```\n\nThe vulnerable behavior has several parts:\n\n- `response[\"location\"]` is trusted as the next token request target.\n- Redirects are followed for every `300..399` response.\n- There is no general redirect counter or maximum redirect limit.\n- Cross-host redirects with the same path can mutate `options[:site]` and rebuild\n  the underlying HTTP client.\n- The recursive call continues the token request flow and signs the next request\n  for the redirected destination.\n\n## Reachable in production\n\nThe vulnerable path is reachable through the normal OAuth 1 token exchange:\n\n```ruby\nconsumer = OAuth::Consumer.new(\n  consumer_key,\n  consumer_secret,\n  site: \"https://provider.example\"\n)\n\nrequest_token = consumer.get_request_token\n```\n\nIf `https://provider.example/oauth/request_token` returns a redirect to an\nattacker-controlled host, the library follows that redirect as part of the token\nrequest flow. A realistic trigger is an OAuth provider, gateway, or reverse proxy\nthat emits `Location` based on user-controlled or tenant-controlled input, or a\nmalicious tenant-controlled OAuth endpoint in a multi-tenant integration.\n\nNo application-level redirect handling is required. The redirect is followed\ninside the gem before the application receives the token response.\n\n## Reproduction\n\nA vulnerable application is one that uses `OAuth::Consumer` to perform an OAuth\n1 token exchange against a token endpoint that can be made to return a redirect\nto another origin.\n\nExample shape:\n\n```ruby\nconsumer = OAuth::Consumer.new(\n  consumer_key,\n  consumer_secret,\n  site: \"https://provider.example\"\n)\n\nconsumer.get_request_token\n```\n\nIf `https://provider.example/oauth/request_token` responds with a `30x` redirect\nwhose `Location` points to `https://attacker.example/...`, affected versions may\nfollow that redirect as part of the token request flow. The redirected request is\nthen generated and signed by the application server for the new destination.\nDepending on the configured OAuth request scheme, OAuth 1 parameters may be sent\nin the `Authorization` header, request body, or query string.\n\nExpected vulnerable behavior:\n\n- the token request leaves the configured OAuth provider origin;\n- the redirected host receives a signed OAuth 1 token request;\n- the application does not get a chance to inspect or approve the redirect target\n  before the redirected request is sent.\n\nExpected patched behavior:\n\n- same-origin redirects continue to work, subject to a redirect limit;\n- cross-origin token endpoint redirects are rejected by default;\n- applications that intentionally require cross-origin token redirects must opt\n  in explicitly with `token_request_cross_origin_redirects`.\n\n## Suggested fix\n\nReject cross-origin token endpoint redirects by default and require explicit\nopt-in for integrations that intentionally depend on that behavior.\n\nThe fix released in v1.1.6 does the following:\n\n```ruby\ncurrent_uri = token_request_uri(path)\nredirected_uri = token_request_redirect_uri(current_uri, response)\nresponse.error! unless redirected_uri\n\nredirect_count = request_options[:token_request_redirect_count].to_i + 1\nresponse.error! if redirect_count > token_request_max_redirects(request_options)\nresponse.error! if token_request_cross_origin?(current_uri, redirected_uri) &&\n  !token_request_cross_origin_redirects?(request_options)\n\nredirect_options = request_options.merge(token_request_redirect_count: redirect_count)\ntoken_request(http_method, token_request_redirect_path(current_uri, redirected_uri), token, redirect_options, *arguments, &block)\n```\n\nThe fix intentionally preserves same-origin redirect compatibility while making\ncross-origin token endpoint redirects an explicit choice. It also avoids placing\ninternal redirect state in `request_options` passed to OAuth signing.\n\n## Workarounds\n\nUntil a patched release is available, applications can reduce exposure by doing\none or more of the following:\n\n- Ensure configured OAuth token endpoints are fixed absolute URLs controlled by a\n  trusted provider.\n- Do not use tenant-controlled OAuth token endpoint URLs unless the tenant is\n  trusted to receive signed OAuth token requests.\n- Block outbound application-server traffic to internal metadata services and\n  other sensitive internal addresses at the network layer.\n- Place a trusted proxy in front of OAuth providers that rejects token endpoint\n  redirects to a different origin.\n\nThese mitigations reduce exploitability but do not remove the vulnerable redirect\nlogic from the gem.\n\n## Credit\n\nFound during the follow-up audit for `GHSA-pp92-crg2-gfv9`.\n\nReporter/coordinator: Peter H. Boling (`pboling`).\n\n## References\n\n- Related OAuth 2 advisory: https://github.com/ruby-oauth/oauth2/security/advisories/GHSA-pp92-crg2-gfv9\n- Fixed version: `oauth` v1.1.6\n- Behavior-introducing commit: https://github.com/ruby-oauth/oauth/commit/d74b767f",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "oauth"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.5.5"
      }, {
        "fixed" : "1.1.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.1.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ruby-oauth/oauth/security/advisories/GHSA-prq8-7wvh-44qh"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby-oauth/oauth/commit/d069dc8c4c9631947451215f07460d6cdf0caf3f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ruby-oauth/oauth"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby-oauth/oauth/releases/tag/v1.1.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-346", "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-28T16:27:11Z",
    "nvd_published_at" : null
  }
}