CVE-2026-141536: Addressable URI#request_uri returns control characters unencoded with possible HTTP request splitting

Published Dec 1, 2026
·
Updated

Impact

Addressable::URI#requesturi returns the path and query as stored, including carriage returns, line feeds, other control characters and spaces. #requesturi 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 #requesturi 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.requesturi would not be affected by this vulnerability, but uri.requesturi 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 #requesturi, and 6.x no longer calls #requesturi. Vulnerable code would need to use some other client implementation that writes #requesturi directly into the HTTP request line.

Affected Versions

This vulnerability affects Addressable >= 2.1.2, the first version with #requesturi. It is fixed in 2.10.0, where #requesturi 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 #requesturi 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 requesturi matches /[\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: Open an issue

Other sources

Addressable is an alternative implementation to the URI implementation that is part of Ruby's standard library. From 2.1.2 until 2.10.0, Addressable::URI#requesturi returns stored control characters and spaces without encoding them. An HTTP client that writes this value directly into an HTTP request line can allow an untrusted URI to terminate the line early and inject headers. With keep-alive, and depending on client and server behavior, the injected text could potentially begin an additional request on the same connection. This issue is fixed in version 2.10.0.

— MITRE

Affected Software

2 affected componentsFixes available
rubygems/addressable>=2.1.2<2.10.0
rubygems/addressable>=2.1.2<=2.9.2
2.10.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/addressable to a version that resolves this vulnerability.

    Fixed in 2.10.0
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.10.0
  3. Compensating control

    Before sending a request, reject URIs whose request_uri matches /[\x00-\x20\x7F]/, or build requests with a client that validates the request line, such as Net::HTTP.

Event History

Dec 1, 2026
CVE Published
via MITRE·09:26 PM
Data Sourced
via MITRE·09:26 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:18 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·11:55 PM
Data Sourced
via GitHub·11:55 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which applications are realistically exposed?

Applications using Addressable versions from 2.1.2 through versions before 2.10.0 are exposed only if an HTTP client writes Addressable::URI#request_uri directly into an HTTP request line and the URI can be influenced by an untrusted source.

2

What does an attacker need to exploit this issue?

An attacker needs to supply a URI containing stored control characters or spaces that reaches Addressable::URI#request_uri. Exploitation also requires the consuming HTTP client to send that returned value without encoding it.

3

Can this lead to more than injected headers?

Potentially. If HTTP keep-alive is in use, the injected text may begin an additional request on the same connection, depending on the behavior of the client and server.

4

What should be done if an immediate upgrade is not possible?

Do not write Addressable::URI#request_uri directly into HTTP request lines for untrusted URIs. Ensure control characters and spaces are encoded or rejected before constructing the request line.

5

How can teams identify affected usage?

Identify dependencies on Addressable versions from 2.1.2 through versions before 2.10.0, then review HTTP request construction for direct use of Addressable::URI#request_uri. Upgrade to Addressable 2.10.0 to obtain the fix.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203