CVE-2026-48596: Tesla has CRLF injection in request `Content-Type` header via `add_content_type_param`
Summary Tesla.Multipart.addcontenttypeparam/2 appends caller-supplied strings to the multipart Content-Type header with no validation. A param value containing \r\n splits the header line, allowing an attacker who controls any content-type parameter (charset, boundary parameter, etc.) to inject arbitrary headers into the outbound HTTP request.
Published Jul 10, 2026
Affected packages
tesla
- Ecosystem
- Erlang (Hex)
- Affected
- >= 0.8.0, < 1.18.3
- Fixed in
- 1.18.3
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Tesla.Multipart.add_content_type_param/2 appends caller-supplied strings to the multipart Content-Type header with no validation. A param value containing \r\n splits the header line, allowing an attacker who controls any content-type parameter (charset, boundary parameter, etc.) to inject arbitrary headers into the outbound HTTP request.
Details
add_content_type_param/2 in lib/tesla/multipart.ex stores the supplied string directly in multipart.content_type_params without any CR/LF check. headers/1 then joins all params with "; " and appends the result verbatim to the Content-Type header value. Because HTTP headers are delimited by \r\n, a param containing that sequence breaks out of the header field and introduces new header lines before the adapter writes the request to the socket.
The precondition is that untrusted input reaches add_content_type_param/2, which is the normal pattern for applications that accept user-supplied charset values, file type parameters, or any other content-type extension fields.
PoC
- Call
Tesla.Multipart.add_content_type_param/2with a value containing\r\nX-Injected: pwned. - Pass the resulting
Multipartstruct as the request body via any Tesla adapter. - The raw request on the wire contains
X-Injected: pwnedas a standalone header line.
Impact
Low severity (CVSS v4.0: 2.1). Any application using tesla 0.8.0 through 1.18.2 that passes untrusted input into Tesla.Multipart.add_content_type_param/2 is affected. Consequences range from forging arbitrary outbound request headers to potential request smuggling against the upstream server. Fixed in tesla 1.18.3.
Workarounds
Validate content-type parameter strings before passing them to Tesla.Multipart.add_content_type_param/2, rejecting any value that contains \r or \n.
Reesources
- Introduction commit: https://github.com/elixir-tesla/tesla/commit/6ebfdb9abe9c6f119408045b933d82462decd351
- Patch commit: https://github.com/elixir-tesla/tesla/commit/23601edac5d22ba9407b427967b5bdbda201aec2
Credited to PJUllrich, yordis, maennchen.
References
- https://github.com/elixir-tesla/tesla/security/advisories/GHSA-q7jx-v53g-848w
- https://nvd.nist.gov/vuln/detail/CVE-2026-48596
- https://github.com/elixir-tesla/tesla/commit/23601edac5d22ba9407b427967b5bdbda201aec2
- https://cna.erlef.org/cves/CVE-2026-48596.html
- https://osv.dev/vulnerability/EEF-CVE-2026-48596
- https://github.com/advisories/GHSA-q7jx-v53g-848w
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Erlang (Hex) vulnerabilities
All Erlang (Hex) entriesCVE-2026-48594
Tesla has decompression bomb on response body
high8.2Jul 10, 2026CVE-2026-48595
Tesla: Authorization header leaks on cross-origin redirect via case-sensitive filtering
high8.2Jul 10, 2026CVE-2026-48597
Tesla vulnerable to atom exhaustion via untrusted URL scheme
high8.2Jul 10, 2026CVE-2026-48598
Tesla vulnerable to multipart part smuggling via unescaped `content-disposition` values
low2.1Jul 10, 2026
