Addressable URI#request_uri returns control characters unencoded with possible HTTP request splitting
Published 1 Dec 2026 · Updated 2 Dec 2026
Affected package
- Affected
- >=2.1.2 <2.10.0
- Fixed in
- 2.10.0
bundle update --conservative addressable # Gemfile: '>= 2.10.0'Which addressable does your project really install?
Works for private projects: the file is read in memory to run the scan and then dropped. Also reads Gemfile.
Public repo?
Look after several Rails or Ruby apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Details
Impact
Addressable::URI#request_uri returns the path and query as stored, including carriage returns, line feeds, other control characters and spaces. #request_uri was designed to be written into an HTTP request line, so a client that does that with a URI built from untrusted input could have the request line ended early and extra headers, or a second request, added after it. The HTTP protocol interprets text after the line break as headers, which can add or override headers such as Host or Authorization, or, with keep-alive, could potentially start a second request on the same connection. What that might achieve depends on the client and the server it talks to.
Addressable::URI.parse and the path= and query= setters accept control characters, and #request_uri joins the path and query without encoding them. RFC 9112 §3 doesn't allow CR, LF or space in a request target, and RFC 3986 doesn't allow them in a URI. #normalize already percent-encodes them, so code that calls uri.normalize.request_uri would not be affected by this vulnerability, but uri.request_uri alone would.
Common clients don't pass the characters through. Net::HTTP raises ArgumentError: A Request-Line must not contain CR or LF. The http gem 5.x percent-encodes them in its own URI normalizer before calling #request_uri, and 6.x no longer calls #request_uri. Vulnerable code would need to use some other client implementation that writes #request_uri directly into the HTTP request line.
Affected Versions
This vulnerability affects Addressable >= 2.1.2, the first version with #request_uri. It is fixed in 2.10.0, where #request_uri percent-encodes control characters (U+0000 to U+001F and U+007F) and space, and leaves every other character as written. Notably, a client that constructed requests using #request_uri would now send them with the characters percent-encoded, where previously it might have raised an exception. This is comparable to the current behavior of the http and faraday gems.
Workarounds
- Reject URIs whose
request_urimatches/[\x00-\x20\x7F]/before sending. - Build requests with a client that validates the request line, such as
Net::HTTP.
Credits
Reported by Praneeth (@praneeth-bala), UCSB SecLab.
For more information
If there are any questions or comments about this advisory:
Is GHSA-qg8x-qm93-fw27 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected addressable, and gives you the command that fixes it.
More advisories for addressable
- LowCVE-2026-141532Addressable URI#origin= takes the host from the userinfo · 2 Dec 2026
- LowCVE-2026-141535Addressable URI#hostname strips brackets from hosts that aren't IP literals · 1 Dec 2026
- LowCVE-2026-141537Addressable URI normalization takes quadratic time on long runs of combining marks · 1 Dec 2026
- MediumCVE-2026-141538Addressable URI userinfo setters store delimiters raw, so the serialized URI names a different host · 1 Dec 2026
- MediumCVE-2026-141539Addressable native IDNA backend truncates a host at a pct-encoded NUL when normalizing · 1 Dec 2026
- LowCVE-2026-141531Addressable display_uri shows a deceptive label boundary for a host label that decodes to U+3002 · 1 Dec 2026
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.