CVE-2026-26962
JSON

4.8medium

Rack: Header injection in multipart requests

Severity
4.8medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.26% (higher than 18% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-rx22-g9mx-qrhv

Description

Rack is a modular Ruby web server interface. From version 3.2.0 to before version 3.2.6, Rack::Multipart::Parser unfolds folded multipart part headers incorrectly. When a multipart header contains an obs-fold sequence, Rack preserves the embedded CRLF in parsed parameter values such as filename or name instead of removing the folded line break during unfolding. As a result, applications that later reuse those parsed values in HTTP response headers may be vulnerable to downstream header injection or response splitting. This issue has been patched in version 3.2.6.

Affected

Product or packageVersionsReported by
rack rack>= 3.2.0, < 3.2.6, from 3.2.0 before 3.2.6CVE List, NVD
rack (RubyGems)from 3.2.0 before 3.2.6GitHub Advisory Database

All scores

GitHub_M4.8medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
GitHub4.8medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
NVD6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Classification

CWE-93

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Rack is a modular Ruby web server interface. From version 3.2.0 to before version 3.2.6, Rack::Multipart::Parser unfolds folded multipart part headers incorrectly. When a multipart header contains an obs-fold sequence, Rack preserves the embedded CRLF in parsed parameter values such as filename or name instead of removing the folded line break during unfolding. As a result, applications that later reuse those parsed values in HTTP response headers may be vulnerable to downstream header injection or response splitting. This issue has been patched in version 3.2.6.

GitHub Advisory Database

Summary

Rack::Multipart::Parser unfolds folded multipart part headers incorrectly. When a multipart header contains an obs-fold sequence, Rack preserves the embedded CRLF in parsed parameter values such as filename or name instead of removing the folded line break during unfolding.

As a result, applications that later reuse those parsed values in HTTP response headers may be vulnerable to downstream header injection or response splitting.

Details

Rack::Multipart::Parser accepts folded multipart header values and unfolds them during parsing. However, the unfolding behavior does not fully remove the embedded line break sequence from the parsed value.

This means a multipart part header such as:

Content-Disposition: form-data; name="file"; filename="test\r\n foo.txt"

can result in a parsed parameter value that still contains CRLF characters.

The issue is not that Rack creates a second multipart header field. Rather, the problem is that CRLF remains embedded in the parsed metadata value after unfolding. If an application later uses that value in a security-sensitive context, such as constructing an HTTP response header, the preserved CRLF may alter downstream header parsing.

Affected values may include multipart parameters such as filename, name, or similar parsed header attributes.

Impact

Applications that accept multipart form uploads may be affected if they later reuse parsed multipart metadata in HTTP headers or other header-sensitive contexts.

In affected deployments, an attacker may be able to supply a multipart parameter value containing folded line breaks and cause downstream header injection, response splitting, cache poisoning, or related response parsing issues.

The practical impact depends on application behavior. If parsed multipart metadata is not reused in HTTP headers, the issue may be limited to incorrect parsing behavior rather than a direct exploit path.

Mitigation

  • Update to a patched version of Rack that removes CRLF correctly when unfolding folded multipart header values.
  • Avoid copying upload metadata such as filename directly into HTTP response headers without sanitization.
  • Sanitize or reject carriage return and line feed characters in multipart-derived values before reusing them in response headers, logs, or downstream protocol contexts.
  • Where feasible, normalize uploaded filenames before storing or reflecting them.
NVD (es)

Rack es una interfaz de servidor web Ruby modular. Desde la versión 3.2.0 hasta antes de la versión 3.2.6, Rack::Multipart::Parser desdobla incorrectamente los encabezados de parte multipart plegados. Cuando un encabezado multipart contiene una secuencia obs-fold, Rack conserva el CRLF incrustado en los valores de parámetros analizados como filename o name en lugar de eliminar el salto de línea plegado durante el desdoblamiento. Como resultado, las aplicaciones que posteriormente reutilizan esos valores analizados en los encabezados de respuesta HTTP pueden ser vulnerables a la inyección de encabezados descendente o a la división de respuesta. Este problema ha sido parcheado en la versión 3.2.6.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-26962 changed 2026-04-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-rx22-g9mx-qrhv changed 2026-09-10CC-BY-4.0
NVDCVE-2026-26962 changed 2026-07-24Public domain