{"id":"CVE-2026-49756","aliases":["CVE-2026-49756","GHSA-px9f-whj3-246m","EEF-CVE-2026-49756"],"related":[],"kind":"vulnerability","state":"published","title":"Multipart form-data header injection in Req via unescaped name/filename/content_type","summary":"Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in wojtekmach Req allows multipart parameter smuggling via attacker-influenced part metadata.\n\nReq.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.\n\nThis 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.\n\nThis issue affects req: from 0.5.3 before 0.6.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Improper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in wojtekmach Req allows multipart parameter smuggling via attacker-influenced part metadata.\n\nReq.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.\n\nThis 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.\n\nThis issue affects req: from 0.5.3 before 0.6.0.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nReq'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.\n\n### Details\n\n`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.\n\nThe 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.\n\n### PoC\n\n1. Construct a malicious `filename` such as `harmless.txt\"\\r\\nX-Smuggled: marker\\r\\nContent-Disposition: form-data; name=\"pwned`.\n2. Call `Req.post!(url, form_multipart: [upload: {\"benign body\", filename: <malicious>, content_type: \"text/plain\"}])`.\n3. The emitted multipart body contains a real `X-Smuggled:` header line and an extra `Content-Disposition` for `name=\"pwned\"`, alongside Req's legitimate headers.\n\n### Impact\n\nHTTP 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"## Summary\n\nImproper Neutralization of CRLF Sequences ('CRLF Injection') vulnerability in wojtekmach Req allows multipart parameter smuggling via attacker-influenced part metadata.\n\n`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.\n\nThis 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.\n\nThis issue affects req: from 0.5.3 before 0.6.0.\n\n## Workarounds\n\nSanitize 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.","format":"markdown","source":"eef"},{"lang":"es","text":"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.\n\nReq.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.\n\nEsto 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.\n\nEste problema afecta a req: desde 0.5.3 antes de 0.6.0.","source":"nvd"}],"published":"2026-06-08T15:20:24.035Z","modified":"2026-11-26T17:23:05.386Z","severity":{"scorer":"EEF","scheme":"CVSS:4.0","vector":"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","score":2.1,"rating":"LOW"},"severities":[{"scorer":"EEF","scheme":"CVSS:4.0","vector":"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","score":2.1,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"Erlang Ecosystem Foundation","scheme":"CVSS:4.0","vector":"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"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","score":3.7,"rating":"LOW"}],"cwes":["CWE-93"],"affected":[{"ranges":[{"type":"semver","introduced":"0.5.3","fixed":"0.6.0","status":"affected"}],"vendor":"wojtekmach","product":"req","package":"req","cpe":"cpe:2.3:a:wojtekmach:req:*:*:*:*:*:*:*:*","repo":"https://github.com/wojtekmach/req","source":"cvelist"},{"ranges":[{"type":"git","introduced":"60253dbe9436cb8e9c738f895032f2e87939b597","fixed":"*","status":"affected"}],"vendor":"wojtekmach","product":"req","package":"wojtekmach/req","cpe":"cpe:2.3:a:wojtekmach:req:*:*:*:*:*:*:*:*","repo":"https://github.com/wojtekmach/req","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.5.3","status":"affected","fixed":"0.6.0"}],"ecosystem":"Hex","package":"req","purl":"pkg:hex/req","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.5.3","status":"affected","fixed":"0.6.0"}],"ecosystem":"Hex","package":"req","purl":"pkg:hex/req","source":"eef"},{"ranges":[{"type":"git","introduced":"60253dbe9436cb8e9c738f895032f2e87939b597","status":"affected","fixed":"2d77dbeb6b2a6932fe181432b1c36e9ea1d9fa23"},{"type":"git","status":"affected","fixed":"74506ff2c5addf74df85d79dc726e9b2e264a8ba"}],"repo":"https://github.com/wojtekmach/req","source":"eef"},{"ranges":[{"status":"affected","introduced":"0.5.3","fixed":"0.6.0"}],"vendor":"wojtekmach","product":"req","cpe":"cpe:2.3:a:wojtekmach:req:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/wojtekmach/req/security/advisories/GHSA-px9f-whj3-246m","tags":["advisory","exploit","related","vendor-advisory","web"],"sources":["cvelist","ghsa","eef","nvd"]},{"url":"https://cna.erlef.org/cves/CVE-2026-49756.html","tags":["mitigation","related","third-party-advisory","web"],"sources":["cvelist","ghsa","eef","nvd"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-49756","tags":["related","third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/wojtekmach/req/commit/60253dbe9436cb8e9c738f895032f2e87939b597","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/wojtekmach/req/commit/2d77dbeb6b2a6932fe181432b1c36e9ea1d9fa23","tags":["fix","patch"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/wojtekmach/req/commit/74506ff2c5addf74df85d79dc726e9b2e264a8ba","tags":["fix","patch","web"],"sources":["cvelist","ghsa","eef","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49756","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/wojtekmach/req","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/wojtekmach/req/releases/tag/v0.6.0","tags":["web"],"sources":["ghsa"]},{"url":"https://hex.pm/packages/req","tags":["package"],"sources":["eef"]}],"credits":["Peter Ullrich","Jonatan Männchen / EEF","Wojtek Mach"],"assigner":"EEF","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-06-08T16:05:54.070Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-49756","url":"https://www.cve.org/CVERecord?id=CVE-2026-49756","licence":"CVE Terms of Use","modified":"2026-11-20T08:43:05.717Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-px9f-whj3-246m","url":"https://github.com/advisories/GHSA-px9f-whj3-246m","licence":"CC-BY-4.0","modified":"2026-07-29T15:52:24.126Z"},{"source":"eef","name":"Erlang Ecosystem Foundation","id":"EEF-CVE-2026-49756","url":"https://osv.dev/vulnerability/EEF-CVE-2026-49756","licence":"CC-BY-4.0","modified":"2026-11-26T17:23:05.386Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-49756","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-49756","licence":"Public domain","modified":"2026-11-20T09:20:12.753Z"}],"updatedAt":"2026-11-26T17:37:06.592Z","epss":{"score":0.00279,"percentile":0.21817,"date":"2026-12-01T12:00:22.000Z"}}