Visit the Wiz Whimzical Shop at AWS re:Invent
Vulnerability DatabaseGHSA-qrq6-rcpx-pmm6

GHSA-qrq6-rcpx-pmm6: 
Ruby vulnerability analysis and mitigation

Impact

Addressable::URI#user=, #password=, #userinfo= and the matching Addressable::URI.new options store the value they are given without encoding or rejecting delimiters. A value containing /, ? or # ends the userinfo early when the URI is serialized, so #to_s names a different host than #host and #origin report. The URI object keeps the component as assigned, and its own accessors agree with each other: host is the host the application set, and origin is built from it. #to_s joins the components with their delimiters but doesn't encode them, so user = "alice@evil.example/" serializes as https://alice@evil.example/@api.example.com/…. Addressable and Ruby's URI both read evil.example as the host of that string. A [ or ] in the userinfo makes the serialized URI fail to parse, a : in the user moves the rest of it into the password, and browsers read a \ as a /, ending the userinfo there. #normalize encodes all of these correctly. An application that puts an untrusted value into the userinfo of a URI for a trusted host, checks host or origin, and then passes to_s to an HTTP client sends the request to a host the attacker chose. Headers or a body meant for the trusted service, such as an API token, go with it. The attacker needs the application to build URIs this way, so attack complexity is high.

Affected Versions

This vulnerability affects Addressable >= 2.0.0. In 2.9.2, #userinfo= ignores a value without a colon, so the injected text has to follow one, as in u:x@evil.example/. It is fixed in 2.10.0, where #user=, #password=, #userinfo=, #authority=, URI.new and URI.parse raise InvalidURIError for /, ?, #, [, ] or \ in the user or password, or : in the user. An @ is still accepted: the last @ ends the userinfo, so it reads the same once serialized.

Workarounds

  • Serialize with uri.normalize.to_s, which encodes the delimiters, instead of uri.to_s.
  • Encode userinfo values before assigning them, for example with Addressable::URI.encode_component(value, Addressable::URI::CharacterClasses::UNRESERVED).
  • Check the host of the final string with Addressable::URI.parse(uri.to_s).host, not of the object.

Credits

Found by Bob Aman (@sporkmonger).

For more information

If there are any questions or comments about this advisory:


Source: NVD

Related Ruby vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-qrq6-rcpx-pmm6MEDIUM4.8
  • Ruby logoRuby
  • addressable
NoYesDec 01, 2026
GHSA-cwmp-x65r-27fvLOW3.7
  • Ruby logoRuby
  • addressable
NoYesDec 02, 2026
GHSA-qg8x-qm93-fw27LOW3.7
  • Ruby logoRuby
  • addressable
NoYesDec 01, 2026
GHSA-c7j3-jq7p-v3prLOW3.7
  • Ruby logoRuby
  • addressable
NoYesDec 01, 2026
GHSA-v6hg-69pc-4f3fLOW3.7
  • Ruby logoRuby
  • addressable
NoYesDec 01, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management