<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Ruby-Oauth - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/ruby-oauth/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 28 Jul 2026 16:33:59 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/ruby-oauth/feed.xml" rel="self" type="application/rss+xml"/><item><title>OAuth2::Client Redirection Vulnerability Leaks Bearer Tokens</title><link>https://feed.craftedsignal.io/briefs/2026-07-oauth2-client-redirect-leak/</link><pubDate>Tue, 28 Jul 2026 16:33:59 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-oauth2-client-redirect-leak/</guid><description>The `OAuth2::Client` in the `oauth2` Ruby gem is vulnerable to credential disclosure and Server-Side Request Forgery (SSRF) due to improper handling of protocol-relative redirect URLs, allowing an attacker to steal bearer tokens and access internal network resources.</description><content:encoded><![CDATA[<p>A critical vulnerability (CVE-2026-54603) exists in the <code>OAuth2::Client</code> component of the <code>oauth2</code> Ruby gem, affecting versions from 0.4.0 up to and including 2.0.21. This flaw stems from improper resolution of protocol-relative redirect URIs within the <code>OAuth2::Client#request</code> method. When an OAuth2 application makes a request and its configured Identity Provider (IdP) or an open-redirect vulnerability can be influenced to return a 30x redirect with a <code>Location</code> header such as <code>//attacker.example/leak</code>, the <code>OAuth2::Client</code> incorrectly merges this URI. As a result, the subsequent request, including the <code>Authorization: Bearer &lt;access-token&gt;</code> header, is redirected to the attacker-controlled host instead of remaining with the trusted IdP. This vulnerability leads to both cross-origin credential disclosure and potential Server-Side Request Forgery (SSRF) from the application server, allowing attackers to steal sensitive tokens and probe internal networks.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An application, using <code>OAuth2::AccessToken</code> via <code>OAuth2::Client</code>, initiates a request to a trusted Identity Provider (IdP) or resource server, including an <code>Authorization: Bearer &lt;access-token&gt;</code> header.</li>
<li>An attacker, by exploiting an open redirect vulnerability on the IdP, configuring a malicious tenant in a multi-tenant setup, or through a network compromise, causes the IdP to issue an HTTP 30x redirect response.</li>
<li>The crafted redirect response's <code>Location</code> header contains a protocol-relative URI pointing to an attacker-controlled host (e.g., <code>//attacker.example/leak</code>).</li>
<li>The <code>OAuth2::Client#request</code> method attempts to resolve this redirect by calling <code>response.response.env.url.merge(location)</code>. Per RFC 3986 §5.2, <code>URI#merge</code> interprets the protocol-relative URI as a network-path reference, which overrides the authority (scheme and host) of the base URL.</li>
<li>The library then recursively re-invokes <code>request(verb, full_location, req_opts)</code> using the newly resolved attacker-controlled URL. Crucially, the <code>req_opts</code> dictionary, containing the original request headers, is passed verbatim.</li>
<li>The <code>Authorization: Bearer &lt;access-token&gt;</code> header, initially set by <code>OAuth2::AccessToken#configure_authentication!</code>, is preserved and transmitted in the request to the attacker's host.</li>
<li>The attacker-controlled server receives the application's bearer token, achieving immediate cross-origin credential disclosure without further user interaction.</li>
<li>Alternatively, if the <code>Location</code> URI specifies an internal network address (e.g., <code>//169.254.169.254/</code>), the application server acts as a Server-Side Request Forgery (SSRF) proxy, allowing the attacker to interact with internal resources.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability results in two primary impacts:</p>
<ol>
<li><strong>Cross-origin credential disclosure:</strong> The immediate consequence is the theft of <code>Authorization: Bearer</code> tokens. Any application utilizing the vulnerable <code>oauth2</code> gem to communicate with an IdP susceptible to such redirection risks having its access tokens exfiltrated to an attacker-controlled server. This can lead to unauthorized access to user data or resources that the stolen token grants access to.</li>
<li><strong>Server-Side Request Forgery (SSRF):</strong> The ability to redirect the application's requests to an arbitrary host also enables SSRF. Attackers can leverage this to force the application server to make requests to internal network services, cloud metadata endpoints (e.g., <code>169.254.169.254</code>), or other restricted resources that are typically inaccessible from the internet. This could facilitate reconnaissance, lateral movement, or further exploitation within an organization's internal infrastructure. Given the widespread use of OAuth2 in modern applications, the potential number of affected services and organizations is substantial across all sectors.</li>
</ol>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade the <code>oauth2</code> gem to version <code>2.0.22</code> or later immediately to address CVE-2026-54603.</li>
<li>Apply the suggested patch logic to <code>OAuth2::Client#request</code> as an interim measure if immediate gem upgrade is not possible. This involves forcing protocol-relative <code>Location</code> values to be interpreted as relative paths by prepending <code>./</code> before <code>URI#merge</code>.</li>
<li>Developers should review their Identity Provider (IdP) and resource server configurations to ensure they do not expose open redirect vulnerabilities that could be abused to supply malicious <code>Location</code> headers.</li>
<li>Implement defense-in-depth measures to strip credential-bearing headers (like <code>Authorization</code>) from requests when a redirect crosses origin boundaries, similar to how robust HTTP clients handle such scenarios.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>oauth2</category><category>ruby</category><category>vulnerability</category><category>credential-disclosure</category><category>ssrf</category><category>redirect</category><category>ghsa</category></item><item><title>Cross-origin OAuth token-request redirects can expose signed request metadata</title><link>https://feed.craftedsignal.io/briefs/2026-07-oauth-cross-origin-redirect/</link><pubDate>Tue, 28 Jul 2026 16:28:12 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-oauth-cross-origin-redirect/</guid><description>The 'oauth' Ruby gem versions 0.5.5 through 1.1.5 are vulnerable to a critical issue (CVE-2026-54605) where the 'OAuth::Consumer#token_request' method improperly handles HTTP 3xx redirects during OAuth 1.0 token exchanges, enabling an attacker to redirect the request to a malicious host, exposing sensitive OAuth 1.0 metadata, and facilitating Server-Side Request Forgery (SSRF) and confused-deputy behavior.</description><content:encoded><![CDATA[<p>The <code>oauth</code> Ruby gem, specifically versions 0.5.5 through 1.1.5, contains a critical vulnerability (CVE-2026-54605) in its <code>OAuth::Consumer#token_request</code> method. This flaw allows for cross-origin signed-request disclosure, Server-Side Request Forgery (SSRF), and confused-deputy behavior. When an application uses the gem to request OAuth 1.0 tokens, the <code>token_request</code> helper follows HTTP 3xx redirects. If an attacker can control or compromise an OAuth server to return a redirect to a malicious host, the vulnerable gem will re-sign the original token request, including sensitive OAuth 1.0 metadata like <code>oauth_consumer_key</code>, <code>oauth_signature</code>, <code>oauth_nonce</code>, and <code>oauth_timestamp</code>, and send it to the attacker-controlled endpoint. This also exposes the application server's network position, enabling SSRF attacks against internal or external targets, and can force the application to make signed requests to unintended origins, leading to confused-deputy scenarios. The vulnerability is due to improper parsing of the <code>Location</code> header, lack of redirect limits, and recursive handling of cross-host redirects that mutate the consumer's configured <code>site</code>. Patching to version 1.1.6 or later is recommended.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An application, using the vulnerable <code>oauth</code> Ruby gem (v0.5.5-1.1.5), initiates an OAuth 1.0 token request (e.g., <code>OAuth::Consumer#get_request_token</code> or <code>OAuth::Consumer#get_access_token</code>) to a legitimate OAuth provider.</li>
<li>The OAuth provider's token endpoint, either compromised or influenced by an attacker, responds with an HTTP 3xx redirect. This redirect's <code>Location</code> header points to an attacker-controlled domain (e.g., <code>https://attacker.example/...</code>).</li>
<li>The vulnerable <code>OAuth::Consumer#token_request</code> method in the <code>oauth</code> gem automatically parses the <code>Location</code> header, modifies the consumer's <code>site</code> configuration to the attacker's domain, and rebuilds its internal HTTP client.</li>
<li>The <code>oauth</code> gem then recursively attempts the token request, this time targeting the attacker-controlled <code>site</code> but still using the application's legitimate OAuth 1.0 consumer key and secrets to sign the request.</li>
<li>The application server makes an outbound network connection, sending the newly signed OAuth 1.0 token request, which now includes sensitive parameters like <code>oauth_consumer_key</code>, <code>oauth_signature</code>, <code>oauth_nonce</code>, and <code>oauth_timestamp</code>, to the attacker-controlled host.</li>
<li>The attacker receives this signed request, gaining access to sensitive integration metadata and potentially discovering internal network services via Server-Side Request Forgery (SSRF) if the attacker's endpoint is crafted to target internal resources from the application server's network position.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of CVE-2026-54605 can result in three main security property losses: <strong>cross-origin signed-request metadata disclosure</strong>, <strong>Server-Side Request Forgery (SSRF) from the application server</strong>, and <strong>confused-deputy behavior</strong>. Attackers can receive sensitive OAuth 1.0 parameters such as <code>oauth_consumer_key</code>, <code>oauth_signature_method</code>, <code>oauth_timestamp</code>, <code>oauth_nonce</code>, <code>oauth_version</code>, and <code>oauth_signature</code>. While the disclosed OAuth 1 signature is bound to the signed request and not a reusable bearer token, it still exposes sensitive integration metadata. SSRF allows the attacker to use the application server's network position to access internal network resources or other targets. Confused-deputy behavior enables a malicious or compromised token endpoint to cause the trusted application to initiate signed requests to unintended origins, potentially granting the attacker unauthorized access or control.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Patch the <code>oauth</code> Ruby gem to version 1.1.6 or later immediately to address CVE-2026-54605.</li>
<li>Ensure configured OAuth token endpoints are fixed absolute URLs controlled by a trusted provider, as described in the &quot;Workarounds&quot; section in the source advisory.</li>
<li>Avoid using tenant-controlled OAuth token endpoint URLs unless the tenant is fully trusted, as outlined in the &quot;Workarounds&quot; section in the source advisory.</li>
<li>Implement network egress filtering to block outbound application-server traffic to internal metadata services and other sensitive internal addresses, particularly for services interacting with the <code>oauth</code> gem.</li>
<li>Deploy a trusted proxy in front of OAuth providers that explicitly rejects token endpoint redirects to different origins, as described in the &quot;Workarounds&quot; section in the source advisory.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>oauth</category><category>vulnerability</category><category>ssrf</category><category>ruby</category><category>gem</category><category>web-application</category></item></channel></rss>