GHSA-q7jx-v53g-848w

Suggest an improvement
Source
https://github.com/advisories/GHSA-q7jx-v53g-848w
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-q7jx-v53g-848w/GHSA-q7jx-v53g-848w.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-q7jx-v53g-848w
Aliases
Published
2026-07-10T00:03:12Z
Modified
2026-07-10T00:15:09Z
Severity
  • 2.1 (Low) CVSS_V4 - CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N CVSS Calculator
Summary
Tesla has CRLF injection in request `Content-Type` header via `add_content_type_param`
Details

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

  1. Call Tesla.Multipart.add_content_type_param/2 with a value containing \r\nX-Injected: pwned.
  2. Pass the resulting Multipart struct as the request body via any Tesla adapter.
  3. The raw request on the wire contains X-Injected: pwned as 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

Database specific
{
    "cwe_ids":  [
        "CWE-113",
        "CWE-93"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-07-10T00:03:12Z",
    "nvd_published_at":  "2026-06-02T20:16:38Z",
    "severity":  "LOW"
}
References

Affected packages

Hex / tesla

Package

Name
tesla
Purl
pkg:hex/tesla

Affected ranges

Type
SEMVER
Events
Introduced
0.8.0
Fixed
1.18.3

Affected versions

0.*
0.8.0
0.9.0
0.10.0
1.*
1.0.0-beta.1
1.0.0
1.1.0
1.2.0
1.2.1
1.3.0
1.3.1
1.3.2
1.3.3
1.4.0
1.4.1
1.4.2
1.4.3
1.4.4
1.5.0
1.5.1
1.6.0
1.6.1
1.7.0
1.8.0
1.8.1
1.9.0
1.10.0
1.10.1
1.10.2
1.10.3
1.11.0
1.11.1
1.11.2
1.12.0
1.12.1
1.12.2
1.12.3
1.13.0
1.13.1
1.13.2
1.14.0
1.14.1
1.14.2
1.14.3
1.15.0
1.15.1
1.15.2
1.15.3
1.16.0
1.17.0
1.18.0
1.18.1
1.18.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-q7jx-v53g-848w/GHSA-q7jx-v53g-848w.json"