CVE-2026-141536: CVE-2026-141536: HTTP Request Splitting and CRLF Injection in Ruby Addressable Gem
CVE-2026-141536: HTTP Request Splitting and CRLF Injection in Ruby Addressable Gem Vulnerability ID: CVE-2026-141536 CVSS Score: 3.7 Published: 2026-12-01 A CRLF injection and HTTP request splitting vulnerability ex
CVE-2026-141536: HTTP Request Splitting and CRLF Injection in Ruby Addressable Gem
Vulnerability ID: CVE-2026-141536
CVSS Score: 3.7
Published: 2026-12-01
A CRLF injection and HTTP request splitting vulnerability exists in the Ruby addressable gem from version 2.1.2 prior to 2.10.0. The Addressable::URI#request_uri method returns stored control characters and spaces without percent-encoding them. When an HTTP client writes the output of #request_uri directly into an HTTP request line without additional validation or normalization, an attacker supplying an untrusted URI can terminate the request line prematurely, inject arbitrary HTTP headers, or initiate a secondary HTTP request over a keep-alive connection.
TL;DR
Addressable::URI#request_uri in versions >= 2.1.2 and < 2.10.0 fails to percent-encode control characters (0x00-0x20, 0x7F), allowing CRLF injection and HTTP request splitting in HTTP clients that interpolate the output directly into raw HTTP request lines.
β οΈ Exploit Status: POC
Technical Details
- Vulnerability ID: CVE-2026-141536 (GHSA-qg8x-qm93-fw27)
- Weakness Type: CWE-93 / CWE-113 (CRLF Injection / HTTP Request Splitting)
- CVSS v3.1 Score: 3.7 Low (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N)
- Affected Component: Addressable::URI#request_uri in addressable gem (>= 2.1.2, < 2.10.0)
- Patched Version: addressable 2.10.0
- Attack Vector: Network (Untrusted URI containing control characters or spaces)
- Security Impact: HTTP Request Line Termination, Arbitrary Header Injection, Request Smuggling
- CISA KEV Status: Not Listed
Affected Systems
- Ruby addressable gem (>= 2.1.2, < 2.10.0)
-
addressable: >= 2.1.2, < 2.10.0 (Fixed in:
2.10.0)
Code Analysis
Commit: 1a46f03
Percent-encode control characters and spaces in Addressable::URI#request_uri while leaving other characters as written.
@@ -1905,17 +1905,40 @@ def query_values=(new_query_values)
self.query = buffer.chop
end
+ REQUEST_TARGET_UNSAFE = /[\x00-\x20\x7F]/n
+ private_constant :REQUEST_TARGET_UNSAFE
+
def request_uri
return nil if self.absolute? && self.scheme !~ /^https?$/i
- return (
+ target = (
(!self.path.empty? ? self.path : SLASH) +
(self.query ? "?#{self.query}" : EMPTY_STR)
)
+ bytes = target.b
+ return target if bytes !~ REQUEST_TARGET_UNSAFE
+ bytes.gsub(REQUEST_TARGET_UNSAFE) do |character|
+ format("%%%02X", character.ord)
+ end.force_encoding(target.encoding)
end
Mitigation Strategies
- Upgrade the addressable RubyGem to version 2.10.0 or later to ensure automatic percent-encoding of control characters and spaces in Addressable::URI#request_uri.
- Normalize untrusted URIs by calling uri.normalize.request_uri prior to constructing HTTP requests if full RFC 3986 normalization is compatible with upstream services.
- Enforce strict request-line validation in custom HTTP client wrappers to reject any request target matching /[\x00-\x20\x7F]/n.
- Use standard HTTP client libraries such as Net::HTTP or http.rb that independently validate or encode request targets prior to socket transmission.
Remediation Steps:
- Audit Gemfile.lock across all Ruby projects to identify deployments using addressable versions >= 2.1.2 and < 2.10.0.
- Update the Gemfile requirement to gem 'addressable', '>= 2.10.0' and run 'bundle update addressable'.
- Review custom HTTP client or socket implementations that invoke Addressable::URI#request_uri to ensure proper handling of untrusted URI inputs.
- Run application test suites to verify that percent-encoding of spaces and control characters in #request_uri does not impact downstream request handling.
References
- GitHub Security Advisory GHSA-qg8x-qm93-fw27
- Patch Commit 1a46f03d6e33c19399e947b13ee5aab5c3a7c586
- Addressable 2.10.0 Release Tag
- NVD Vulnerability Detail: CVE-2026-141536
- CVE.org Record: CVE-2026-141536
- CVEProject cvelistV5 JSON Record
- GitHub Advisory Database OSV Record
Read the full report for CVE-2026-141536 on our website for more details including interactive diagrams and full exploit analysis.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.