Rack is a modular Ruby web server interface. Prior to 2.2.26, 3.1.24, and 3.2.9, Rack::Multipart::Parser.parseboundary locates boundary= as a substring anywhere in a Content-Type header instead of parsing named parameters consistently with Rack::MediaType.params, truncates quoted boundary values at delimiters, preserves surrounding whitespace, and does not correctly process quoted-pair escapes. A conforming intermediary can therefore find no boundary or a different boundary while Rack parses attacker-controlled multipart parts, allowing form fields or uploads to bypass web application firewall inspection. Exploitation requires an intermediary that inspects multipart bodies using a conforming parser, and Rack itself grants no capability beyond a well-formed request carrying the same body. This issue is fixed in versions 2.2.26, 3.1.24, and 3.2.9.
Rack is a modular Ruby web server interface. From 2.2.0 until 2.2.26, 3.1.24, and 3.2.9, Rack::Directory#get checks a path containing dot-dot segments with File.expandpath but then passes the original unnormalized path to File.stat and Dir.foreach instead of first applying Utils.cleanpathinfo. Earlier Rack versions reject every path containing dot-dot and are not affected. When a directory beneath the served root is a symbolic link followed by .., the operating system resolves the link before applying the dot-dot segment, allowing an unauthenticated request to list the target's parent or siblings outside the root. The disclosure is limited to directory entry names, sizes, and modification times because Rack::Files normalizes paths before serving file contents. This issue is fixed in versions 2.2.26, 3.1.24, and 3.2.9.
Rack is a modular Ruby web server interface. From 3.0.0 until 3.1.24 and 3.2.9, Rack::Multipart::Parser#tagmultipartencoding calls Encoding.find for every charset parameter in a multipart part's Content-Type header without first checking Encoding.namelist. For an unknown name, Ruby searches each directory on $LOADPATH for an encoding library before raising ArgumentError, and Rack catches the exception without caching the failure or limiting repeated charset parameters. An unauthenticated attacker can send thousands of unknown charset parameters in a relatively small multipart request, occupying a worker thread for tens of seconds or longer, with cost increasing as the application's load path grows. Rack 2.2 is not affected by this denial of service because the first unknown charset aborts parsing. This issue is fixed in versions 3.1.24 and 3.2.9.
Rack is a modular Ruby web server interface. Prior to 2.2.26, 3.1.24, and 3.2.9, Rack::QueryParser uses the quantified DEFAULTSEP and COMMONSEP regular expressions when splitting query strings and application/x-www-form-urlencoded bodies, while paramshashhaskey? and the Rack 2.2 normalizeparams path use quantified expressions for bracketed parameter names. Long runs of spaces after an ampersand, or long runs of bracket characters in a parameter name, cause Ruby's regular expression engine to allocate approximately 48 bytes of backtracking state per input character. RACKQUERYPARSERBYTESIZELIMIT bounds the request size but not this amplification, and RACKQUERYPARSERPARAMSLIMIT does not prevent it because very few parameters are required. An unauthenticated attacker can cause substantial transient memory allocation with one request, and concurrent requests can exhaust process or container memory. This issue is fixed in versions 2.2.26, 3.1.24, and 3.2.9.
Rack is a modular Ruby web server interface. Prior to 2.2.26, 3.1.24, and 3.2.9, Rack::Multipart::Parser incompletely prevents carriage return and line feed characters from multipart part headers from reaching parsed values. In Rack 3.1.16 and later and Rack 3.2, folded Content-ID values can become parameter names when Content-Disposition is missing or exceeds CONTENTDISPOSITIONMAXBYTES because Content-ID is not unfolded. In Rack 2.2, quoted name or filename values and Content-Type values can match across line breaks. Applications that reuse these parameter names or uploaded-file content types in response headers, log lines, or other CRLF-delimited contexts may permit header injection, response splitting, or log forgery, while Rack itself does not write these values to those sinks. Rack 3.0 is affected. This issue is fixed in versions 2.2.26, 3.1.24, and 3.2.9.
Summary
Rack::Static normalizes the request path with Utils.cleanpathinfo when deciding which file to serve, but matches headerrules against a path that is only URL-decoded. A request containing dot segments, raw or percent-encoded, is served the normalized target file while the header rules for that file's location are not applied.
This allows an attacker to receive a protected static file without the security headers configured for it.
Details
Rack::Static#call computes the served path as Utils.cleanpathinfo(Utils.unescapepath(path)). Rack::Static#applicablerules applies only Utils.unescapepath before testing string and regular expression rules. A request for /assets/../uploads/file.html or /assets/..%2fuploads/file.html is served as uploads/file.html, but the decoded path /assets/../uploads/file.html does not start with uploads, so a rule scoped to that directory never matches.
The fix for CVE-2026-34786 (GHSA-q4qf-9j86-f5mh) added URL decoding to rule matching but did not add dot segment normalization, so versions that include that fix remain affected.
Impact
Applications that use Rack::Static headerrules to attach security-relevant headers to particular paths or file types are affected. An unauthenticated attacker who knows the path of a protected file can request it through a dot segment path and receive it without those headers, for example without Content-Disposition: attachment or a restrictive Content-Security-Policy that prevents uploaded HTML from rendering inline. The file itself is served unchanged. Applications that do not use path-specific headerrules are not affected.
Mitigation
Update to a patched version of Rack in which headerrules are matched against the same normalized path used to serve the file. Reject requests containing dot segments at a reverse proxy or application boundary. Do not rely solely on Rack::Static headerrules to prevent inline rendering of untrusted uploads; serve them from a separate origin.
Credit Reporter and Remediation developer
Summary
Rack::Static normalizes the request path with Utils.cleanpathinfo when deciding which file to serve, but matches headerrules against a path that is only URL-decoded. A request containing dot segments, raw or percent-encoded, is served the normalized target file while the header rules for that file's location are not applied.
This allows an attacker to receive a protected static file without the security headers configured for it.
Details
Rack::Static#call computes the served path as Utils.cleanpathinfo(Utils.unescapepath(path)). Rack::Static#applicablerules applies only Utils.unescapepath before testing string and regular expression rules. A request for /assets/../uploads/file.html or /assets/..%2fuploads/file.html is served as uploads/file.html, but the decoded path /assets/../uploads/file.html does not start with uploads, so a rule scoped to that directory never matches.
The fix for CVE-2026-34786 (GHSA-q4qf-9j86-f5mh) added URL decoding to rule matching but did not add dot segment normalization, so versions that include that fix remain affected.
Impact
Applications that use Rack::Static headerrules to attach security-relevant headers to particular paths or file types are affected. An unauthenticated attacker who knows the path of a protected file can request it through a dot segment path and receive it without those headers, for example without Content-Disposition: attachment or a restrictive Content-Security-Policy that prevents uploaded HTML from rendering inline. The file itself is served unchanged. Applications that do not use path-specific headerrules are not affected.
Mitigation
Update to a patched version of Rack in which headerrules are matched against the same normalized path used to serve the file. Reject requests containing dot segments at a reverse proxy or application boundary. Do not rely solely on Rack::Static headerrules to prevent inline rendering of untrusted uploads; serve them from a separate origin.
Credit Reporter and Remediation developer
Summary
Rack::Request#hostwithport, and therefore #baseurl and #url, return the raw authority string when it fails validation. An attacker-controlled Host, X-Forwarded-Host, or Forwarded: host= value containing characters that are not permitted in an authority is embedded verbatim in URLs generated by the application.
This completes the fix for CVE-2026-34835 (GHSA-g2pf-xv49-m2h5), which made #host and #hostname return nil for an invalid authority but left this path unchanged.
Details
Rack::Request#hostwithport splits the authority with splitauthority. When the AUTHORITY pattern does not match, no components are returned and hostwithport falls back to returning the unvalidated authority string. baseurl is "#{scheme}://#{hostwithport}" and url appends the full path, so both inherit the raw value.
For a request with Host: evil.com/@legit.com, host returns nil while hostwithport returns evil.com/@legit.com and baseurl returns http://evil.com/@legit.com. A valid Host together with an invalid X-Forwarded-Host produces the same result, because forwarded headers take priority by default.
Impact
Applications that build absolute URLs, redirects, or origin-dependent checks from req.url, req.baseurl, or req.hostwithport, and that do not enforce a host allowlist, may emit URLs containing attacker-chosen characters such as @, /, ?, #, spaces, or angle brackets. Generated links and Location headers can be redirected through userinfo tricks, string-based URL checks can be bypassed, and markup is reflected where the application does not escape the value. For example, redirect in Sinatra behind a proxy that forwards X-Forwarded-Host emits the raw invalid authority in Location.
Rails overrides these methods in Action Dispatch and is not expected to be affected. Rack 3.1 and 3.2 are affected. Rack 2.2 did not receive the CVE-2026-34835 change and returns the raw value from every host method.
Mitigation
Update to a patched version of Rack, in which hostwithport returns nil for an invalid authority and baseurl falls back to the server's own name. Enforce a host allowlist with Rack::Protection::HostAuthorization, config.hosts in Rails, or at the reverse proxy, and configure the proxy to overwrite X-Forwarded-Host and Forwarded. Pin the authority with the rack.request.config :authority key where available.
Summary
Rack::Request#hostwithport, and therefore #baseurl and #url, return the raw authority string when it fails validation. An attacker-controlled Host, X-Forwarded-Host, or Forwarded: host= value containing characters that are not permitted in an authority is embedded verbatim in URLs generated by the application.
This completes the fix for CVE-2026-34835 (GHSA-g2pf-xv49-m2h5), which made #host and #hostname return nil for an invalid authority but left this path unchanged.
Details
Rack::Request#hostwithport splits the authority with splitauthority. When the AUTHORITY pattern does not match, no components are returned and hostwithport falls back to returning the unvalidated authority string. baseurl is "#{scheme}://#{hostwithport}" and url appends the full path, so both inherit the raw value.
For a request with Host: evil.com/@legit.com, host returns nil while hostwithport returns evil.com/@legit.com and baseurl returns http://evil.com/@legit.com. A valid Host together with an invalid X-Forwarded-Host produces the same result, because forwarded headers take priority by default.
Impact
Applications that build absolute URLs, redirects, or origin-dependent checks from req.url, req.baseurl, or req.hostwithport, and that do not enforce a host allowlist, may emit URLs containing attacker-chosen characters such as @, /, ?, #, spaces, or angle brackets. Generated links and Location headers can be redirected through userinfo tricks, string-based URL checks can be bypassed, and markup is reflected where the application does not escape the value. For example, redirect in Sinatra behind a proxy that forwards X-Forwarded-Host emits the raw invalid authority in Location.
Rails overrides these methods in Action Dispatch and is not expected to be affected. Rack 3.1 and 3.2 are affected. Rack 2.2 did not receive the CVE-2026-34835 change and returns the raw value from every host method.
Mitigation
Update to a patched version of Rack, in which hostwithport returns nil for an invalid authority and baseurl falls back to the server's own name. Enforce a host allowlist with Rack::Protection::HostAuthorization, config.hosts in Rails, or at the reverse proxy, and configure the proxy to overwrite X-Forwarded-Host and Forwarded. Pin the authority with the rack.request.config :authority key where available.
Summary
The guard added for CVE-2026-26961 (GHSA-vgpv-f759-9wx3), which rejects multipart requests with more than one boundary parameter, only inspects the part of the Content-Type header after the boundary it extracts. A Content-Type whose first boundary parameter is empty or begins with a quote, semicolon, or comma is skipped by the extraction pattern, so a second boundary parameter is accepted silently and Rack parses the body with a boundary that a conforming parser would not derive from the header.
Details
Rack::Multipart::Parser.parseboundary extracts the boundary with a regular expression that uses a lazy prefix and a value class excluding ", ;, and ,. For a header such as multipart/form-data; boundary=";boundary=AaB03x" or multipart/form-data; boundary=; boundary=AaB03x, the pattern skips the first boundary= and anchors on the second, and the subsequent check for another boundary= in the remaining text finds nothing. Rack then uses AaB03x.
RFC 9110 parses the first header as a single parameter whose value is ;boundary=AaB03x, which is not a legal boundary under RFC 2046, so the only conformant outcome is rejection. Inspecting intermediaries that implement the standard grammar, such as ModSecurity, see a different boundary or no multipart body at all.
The fix counts boundary= occurrences across the entire header value and rejects the request when there is more than one.
Impact
As with CVE-2026-26961, an attacker can craft a multipart request that a web application firewall or other inspecting proxy in front of a Rack application interprets differently from Rack, so form fields and file uploads reach the application without inspection. Rack itself grants no capability beyond that of a well-formed request with the same body. All supported versions, including 2.2, are affected.
Mitigation
Update to a patched version of Rack. Reject requests whose Content-Type contains more than one boundary parameter at the reverse proxy.
Summary
The guard added for CVE-2026-26961 (GHSA-vgpv-f759-9wx3), which rejects multipart requests with more than one boundary parameter, only inspects the part of the Content-Type header after the boundary it extracts. A Content-Type whose first boundary parameter is empty or begins with a quote, semicolon, or comma is skipped by the extraction pattern, so a second boundary parameter is accepted silently and Rack parses the body with a boundary that a conforming parser would not derive from the header.
Details
Rack::Multipart::Parser.parseboundary extracts the boundary with a regular expression that uses a lazy prefix and a value class excluding ", ;, and ,. For a header such as multipart/form-data; boundary=";boundary=AaB03x" or multipart/form-data; boundary=; boundary=AaB03x, the pattern skips the first boundary= and anchors on the second, and the subsequent check for another boundary= in the remaining text finds nothing. Rack then uses AaB03x.
RFC 9110 parses the first header as a single parameter whose value is ;boundary=AaB03x, which is not a legal boundary under RFC 2046, so the only conformant outcome is rejection. Inspecting intermediaries that implement the standard grammar, such as ModSecurity, see a different boundary or no multipart body at all.
The fix counts boundary= occurrences across the entire header value and rejects the request when there is more than one.
Impact
As with CVE-2026-26961, an attacker can craft a multipart request that a web application firewall or other inspecting proxy in front of a Rack application interprets differently from Rack, so form fields and file uploads reach the application without inspection. Rack itself grants no capability beyond that of a well-formed request with the same body. All supported versions, including 2.2, are affected.
Mitigation
Update to a patched version of Rack. Reject requests whose Content-Type contains more than one boundary parameter at the reverse proxy.
Rack provides an interface for developing web applications in Ruby. Prior to versions 2.2.11, 3.0.12, and 3.1.11, Rack::CommonLogger can be exploited by crafting input that includes newline characters to manipulate log entries. The supplied proof-of-concept demonstrates injecting malicious content into logs. When a user provides the authorization credentials via Rack::Auth::Basic, if success, the username will be put in env['REMOTEUSER'] and later be used by Rack::CommonLogger for logging purposes. The issue occurs when a server intentionally or unintentionally allows a user creation with the username contain CRLF and white space characters, or the server just want to log every login attempts. If an attacker enters a username with CRLF character, the logger will log the malicious username with CRLF characters into the logfile. Attackers can break log formats or insert fraudulent entries, potentially obscuring real activity or injecting malicious data into log files. Versions 2.2.11, 3.0.12, and 3.1.11 contain a fix.
It was discovered that Rack was not properly parsing data when processing multipart POST requests. If a user or automated system were tricked into sending a specially crafted multipart POST request to an application using Rack, a remote attacker could possibly use this issue to cause a denial of service. (CVE-2022-30122) It was discovered that Rack was not properly escaping untrusted data when performing logging operations, which could cause shell escaped sequences to be written to a terminal. If a user or automated system were tricked into sending a specially crafted request to an application using Rack, a remote attacker could possibly use this issue to execute arbitrary code in the machine running the application. (CVE-2022-30123)
Upstream released [1] Rack 1.4.2, 1.3.7, 1.2.6, and 1.1.4 to fix a denial of service condition when Rack parses content with a certain Content-Disposition header as noted in the original report [2].
This has been fixed in git [3].
Additionally, a second flaw that was fixed in 1.4.4, 1.3.9, 1.2.7, and 1.1.5 was also announced [4] that creates a minor denial of service condition, this time in the Rack::Auth::AbstractRequest, where it symbolized arbitrary strings (apparently this has something to do with authentication, but there is no further information provided other than the fix [5] itself, which is noted as "a breaking API change").
[1] http://rack.github.com/ [2] https://groups.google.com/forum/#!msg/rack-devel/1w4fWEgTdI/XAkSNHjtdTsJ [3] https://github.com/rack/rack/commit/4fc44671b3cad569421f4f8b775c0590b86f575e [4] https://groups.google.com/forum/#!topic/rack-devel/ImYOqcGiksw/discussion [5] https://github.com/rack/rack/commit/0c76175fcccad74ba2f991c487d3669c28a297c8