GHSA-qg8x-qm93-fw27

Suggest an improvement
Source
https://github.com/advisories/GHSA-qg8x-qm93-fw27
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-qg8x-qm93-fw27/GHSA-qg8x-qm93-fw27.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-qg8x-qm93-fw27
Aliases
Downstream
CGA (9)
Published
2026-12-01T23:55:58Z
Modified
2026-12-02T00:15:03Z
Severity
  • 3.7 (Low) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N CVSS Calculator
Summary
Addressable URI#request_uri returns control characters unencoded with possible HTTP request splitting
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_uri 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:

Database specific
{
    "cwe_ids":  [
        "CWE-113",
        "CWE-93"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-12-01T23:55:58Z",
    "nvd_published_at":  null,
    "severity":  "LOW"
}
References

Affected packages

RubyGems / addressable

Package

Name
addressable
Purl
pkg:gem/addressable

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.1.2
Fixed
2.10.0

Affected versions

2.*
2.1.2
2.2.0
2.2.1
2.2.2
2.2.3
2.2.4
2.2.5
2.2.6
2.2.7
2.2.8
2.3.2
2.3.3
2.3.4
2.3.5
2.3.6
2.3.7
2.3.8
2.4.0
2.5.0
2.5.1
2.5.2
2.6.0
2.7.0
2.8.0
2.8.1
2.8.2
2.8.3
2.8.4
2.8.5
2.8.6
2.8.7
2.8.8
2.8.9
2.8.10
2.9.0
2.9.1
2.9.2

Database specific

last_known_affected_version_range
"<= 2.9.2"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-qg8x-qm93-fw27/GHSA-qg8x-qm93-fw27.json"