2.1low
Multipart form-data header injection in Req via unescaped name/filename/content_type
- Severity
- 2.1low CVSS:4.0 by EEF
- Exploit likelihood
- 0.28% (higher than 21% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- EEF
- Also known as
- GHSA-px9f-whj3-246mEEF-CVE-2026-49756
Description
Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in wojtekmach Req allows multipart parameter smuggling via attacker-influenced part metadata. Req.Utils.encode_form_part/2 in lib/req/utils.ex builds the per-part headers by interpolating the caller-supplied name, filename, and content_type values directly into the content-disposition and content-type lines with no escaping or CRLF stripping. A value containing ", \r, or \n closes the surrounding quoted value and starts a new header line; an additional \r\n--<boundary> terminates the current part and prepends a smuggled part of the attacker's choosing. This is reachable through every supported way of supplying a part. It is particularly easy when value is a %File.Stream{}, because filename then defaults to Path.basename(stream.path) and POSIX filenames may legitimately contain \r and \n. Any application that forwards user-controlled filenames (or field names / MIME types) through Req.post/2 with form_multipart: lets an attacker inject arbitrary headers into the outgoing multipart body or smuggle additional fields and parts into the request the victim service sends downstream. This issue affects req: from 0.5.3 before 0.6.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| req | from 0.5.3 before 0.6.0 | CVE List |
| wojtekmach/req | from 60253dbe9436cb8e9c738f895032f2e87939b597 before * | CVE List |
| req (Hex) | from 0.5.3 before 0.6.0 | GitHub Advisory Database, Erlang Ecosystem Foundation |
| https://github.com/wojtekmach/req | from 60253dbe9436cb8e9c738f895032f2e87939b597 before 2d77dbeb6b2a6932fe181432b1c36e9ea1d9fa23, before 74506ff2c5addf74df85d79dc726e9b2e264a8ba | Erlang Ecosystem Foundation |
| wojtekmach req | from 0.5.3 before 0.6.0 | NVD |
All scores
| EEF | 2.1low CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N |
| Erlang Ecosystem Foundation | Not scored CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N |
| NVD | 3.7low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N |
Classification
SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.
What each source says
CVE List
Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in wojtekmach Req allows multipart parameter smuggling via attacker-influenced part metadata. Req.Utils.encode_form_part/2 in lib/req/utils.ex builds the per-part headers by interpolating the caller-supplied name, filename, and content_type values directly into the content-disposition and content-type lines with no escaping or CRLF stripping. A value containing ", \r, or \n closes the surrounding quoted value and starts a new header line; an additional \r\n--<boundary> terminates the current part and prepends a smuggled part of the attacker's choosing. This is reachable through every supported way of supplying a part. It is particularly easy when value is a %File.Stream{}, because filename then defaults to Path.basename(stream.path) and POSIX filenames may legitimately contain \r and \n. Any application that forwards user-controlled filenames (or field names / MIME types) through Req.post/2 with form_multipart: lets an attacker inject arbitrary headers into the outgoing multipart body or smuggle additional fields and parts into the request the victim service sends downstream. This issue affects req: from 0.5.3 before 0.6.0.
GitHub Advisory Database
Summary
Req's multipart form encoder interpolates the per-part name, filename, and content_type directly into the part headers without escaping. An attacker who can influence any of those values can inject CRLF-separated header lines, smuggle additional form fields, or prepend a whole extra part into the request the victim service sends downstream.
Details
Req.Utils.encode_form_part/2 in lib/req/utils.ex builds the per-part header iodata by concatenating the three caller-supplied strings verbatim into content-disposition: form-data; name="<name>"; filename="<filename>" and content-type: <content_type>. There is no CRLF stripping, no quote escaping, and no validation. A value containing "\r\n closes the surrounding quoted value and starts a new header line; an additional \r\n--<boundary> terminates the current part and lets the attacker prepend a smuggled part.
The flaw is reachable through every supported way of supplying a part. It is especially easy to hit when value is a %File.Stream{}, because filename then defaults to Path.basename(stream.path) and POSIX filenames may legitimately contain \r and \n. RFC 7578 / WHATWG form-data requires percent-encoding ", CR, and LF in these fields; the fix adopts that behavior.
PoC
- Construct a malicious
filenamesuch asharmless.txt"\r\nX-Smuggled: marker\r\nContent-Disposition: form-data; name="pwned. - Call
Req.post!(url, form_multipart: [upload: {"benign body", filename: <malicious>, content_type: "text/plain"}]). - The emitted multipart body contains a real
X-Smuggled:header line and an extraContent-Dispositionforname="pwned", alongside Req's legitimate headers.
Impact
HTTP request smuggling / multipart parameter smuggling in the HTTP client. Any application using Req to send form_multipart requests where any of name, filename, or content_type can be influenced by an untrusted source is affected, most commonly upload proxies and re-uploaders that derive filename from Path.basename/1 on a user-controlled path.
Erlang Ecosystem Foundation
Summary
Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in wojtekmach Req allows multipart parameter smuggling via attacker-influenced part metadata.
Req.Utils.encode_form_part/2 in lib/req/utils.ex builds the per-part headers by interpolating the caller-supplied name, filename, and content_type values directly into the content-disposition and content-type lines with no escaping or CRLF stripping. A value containing ", \r, or \n closes the surrounding quoted value and starts a new header line; an additional \r\n--<boundary> terminates the current part and prepends a smuggled part of the attacker's choosing.
This is reachable through every supported way of supplying a part. It is particularly easy when value is a %File.Stream{}, because filename then defaults to Path.basename(stream.path) and POSIX filenames may legitimately contain \r and \n. Any application that forwards user-controlled filenames (or field names / MIME types) through Req.post/2 with form_multipart: lets an attacker inject arbitrary headers into the outgoing multipart body or smuggle additional fields and parts into the request the victim service sends downstream.
This issue affects req: from 0.5.3 before 0.6.0.
Workarounds
Sanitize attacker-influenced name, filename, and content_type values before passing them to Req.post/2 with form_multipart:. At minimum, reject (or strip) any value containing \r, \n, or ". When forwarding uploads, derive filename from a normalised string rather than Path.basename/1 on a user-controlled path.
NVD (es)
La vulnerabilidad de Neutralización Incorrecta de Secuencias CRLF ('Inyección CRLF') en wojtekmach Req permite el contrabando de parámetros multipart a través de metadatos de parte influenciados por el atacante. Req.Utils.encode_form_part/2 en lib/req/utils.ex construye los encabezados por parte interpolando los valores de nombre, nombre de archivo y tipo de contenido suministrados por el llamador directamente en las líneas de content-disposition y content-type sin escape ni eliminación de CRLF. Un valor que contiene ", \r, o \n cierra el valor entre comillas circundante y comienza una nueva línea de encabezado; un \r\n--<boundary> adicional termina la parte actual y antepone una parte contrabandeada a elección del atacante. Esto es alcanzable a través de cada forma compatible de suministrar una parte. Es particularmente fácil cuando el valor es un %File.Stream{}, porque el nombre de archivo por defecto es Path.basename(stream.path) y los nombres de archivo POSIX pueden contener legítimamente \r y \n. Cualquier aplicación que reenvíe nombres de archivo controlados por el usuario (o nombres de campo / tipos MIME) a través de Req.post/2 con form_multipart: permite a un atacante inyectar encabezados arbitrarios en el cuerpo multipart saliente o contrabandear campos y partes adicionales en la solicitud que el servicio víctima envía aguas abajo. Este problema afecta a req: desde 0.5.3 antes de 0.6.0.
References
| https://github.com/wojtekmach/req/security/advisories/GHSA-px9f-whj3-246m | advisory, exploit, related, vendor-advisory, web | |
| https://cna.erlef.org/cves/CVE-2026-49756.html | mitigation, related, third-party-advisory, web | |
| https://osv.dev/vulnerability/EEF-CVE-2026-49756 | related, third-party-advisory, web | |
| https://github.com/wojtekmach/req/commit/60253dbe9436cb8e9c738f895032f2e87939b597 | related, web | |
| https://github.com/wojtekmach/req/commit/2d77dbeb6b2a6932fe181432b1c36e9ea1d9fa23 | fix, patch | |
| https://github.com/wojtekmach/req/commit/74506ff2c5addf74df85d79dc726e9b2e264a8ba | fix, patch, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-49756 | advisory | |
| https://github.com/wojtekmach/req | package | |
| https://github.com/wojtekmach/req/releases/tag/v0.6.0 | web | |
| https://hex.pm/packages/req | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-49756 changed 2026-11-20 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-px9f-whj3-246m changed 2026-07-29 | CC-BY-4.0 |
| Erlang Ecosystem Foundation | EEF-CVE-2026-49756 changed 2026-11-26 | CC-BY-4.0 |
| NVD | CVE-2026-49756 changed 2026-11-20 | Public domain |