CVE-2026-12143
JSON

8.7high

form-data does not escape CR/LF/quote in multipart field names and filenames (CRLF injection)

Severity
8.7high CVSS:4.0 by harborist
Exploit likelihood
1.36% (higher than 72% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
harborist
Also known as
GHSA-hmw2-7cc7-3qxx

Description

form-data is a library for creating readable multipart/form-data streams. In versions through 4.0.5, the `field` argument to `FormData#append` and the `filename` option are concatenated verbatim into the `Content-Disposition` header without escaping carriage return (CR), line feed (LF), or double-quote (") characters. An application that passes attacker-controlled data as a field name or filename (for example, an API gateway that turns JSON object keys into multipart field names) allows the attacker to terminate the header line and inject additional headers, or to smuggle entire additional multipart parts, into the request the application forwards to a backend. This can let the attacker add or override form fields (e.g. set `is_admin=true`) seen by the downstream parser. This is an instance of CWE-93 (CRLF injection). The fix escapes CR, LF, and `"` as `%0D`, `%0A`, and `%22` in field names and filenames, matching the serialization browsers use per the WHATWG HTML multipart/form-data encoding algorithm. Exploitation requires the consuming application to use untrusted input as a field name or filename; applications that use only fixed/trusted field names are not affected. Fixed in 2.5.6, 3.0.5, and 4.0.6.

Affected

Product or packageVersionsReported by
form-databefore 2.5.6, from 3.0.0 before 3.0.5, from 4.0.0 before 4.0.6CVE List
cryostat/cryostat-openshift-console-plugin-rhel9Not specified
Not affected: from 4.2.0-13 before *
CVE List
automation-platform-uiNot specified
Not affected: from 0:2.6.13-1.el9ap before *
CVE List
rh-podman-desktopNot specified
Not affected: from 0:1.1.2-1.el10_2 before *
CVE List
cluster-observability-operator/distributed-tracing-console-plugin-pf4-rhel9Not specified
Not affected: from 1782840519 before *
CVE List
cluster-observability-operator/distributed-tracing-console-plugin-pf5-rhel9Not specified
Not affected: from 1782839981 before *
CVE List
cluster-observability-operator/distributed-tracing-console-plugin-pf6-rhel9Not specified
Not affected: from 1782839193 before *
CVE List
cluster-observability-operator/distributed-tracing-console-plugin-rhel9Not specified
Not affected: from 1782838753 before *
CVE List
cluster-observability-operator/logging-console-plugin-pf4-rhel9Not specified
Not affected: from 1782839279 before *
CVE List
cluster-observability-operator/logging-console-plugin-pf5-rhel9Not specified
Not affected: from 1782840539 before *
CVE List
cluster-observability-operator/logging-console-plugin-rhel9Not specified
Not affected: from 1782841925 before *
CVE List
cluster-observability-operator/monitoring-console-plugin-pf5-rhel9Not specified
Not affected: from 1782844225 before *
CVE List

All scores

harborist8.7high CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
harborist7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
redhat-SADP7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Classification

CWE-93

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

form-data is a library for creating readable multipart/form-data streams. In versions through 4.0.5, the `field` argument to `FormData#append` and the `filename` option are concatenated verbatim into the `Content-Disposition` header without escaping carriage return (CR), line feed (LF), or double-quote (") characters. An application that passes attacker-controlled data as a field name or filename (for example, an API gateway that turns JSON object keys into multipart field names) allows the attacker to terminate the header line and inject additional headers, or to smuggle entire additional multipart parts, into the request the application forwards to a backend. This can let the attacker add or override form fields (e.g. set `is_admin=true`) seen by the downstream parser. This is an instance of CWE-93 (CRLF injection). The fix escapes CR, LF, and `"` as `%0D`, `%0A`, and `%22` in field names and filenames, matching the serialization browsers use per the WHATWG HTML multipart/form-data encoding algorithm. Exploitation requires the consuming application to use untrusted input as a field name or filename; applications that use only fixed/trusted field names are not affected. Fixed in 2.5.6, 3.0.5, and 4.0.6.

GitHub Advisory Database

Summary

form-data builds multipart/form-data request bodies. Through v4.0.5, the field name passed to FormData#append and the filename option are concatenated directly into the Content-Disposition header with no escaping of CR (\r), LF (\n), or ". An application that uses untrusted input as a field name or filename therefore lets an attacker terminate the header line and either inject additional headers or smuggle whole additional multipart parts into the request the application forwards to a backend.

This is CWE-93 (CRLF injection). It is a divergence from how browsers and the WHATWG HTML spec serialize form-data (they escape these characters), so the fix is to match that behavior. Severity is conditional: it depends on the consuming application passing attacker-controlled data as a field name or filename. Applications that only use fixed/trusted field names are not affected.

Details

In lib/form_data.js, _multiPartHeader builds the part header as:

'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || [])

and _getContentDisposition builds filename="' + filename + '"'. Neither escapes control characters, so a \r\n in field/filename ends the header line. The same applies to ", which can break out of the quoted parameter.

Proof of concept
const FormData = require('form-data');
const form = new FormData();
form.append('email"\r\nX-Injected: true\r\nfake="', 'user@example.com');
console.log(form.getBuffer().toString());

Before the fix this emits an injected X-Injected: true header line. A field name that also includes --<boundary> sequences can introduce additional parts (e.g. an extra name="is_admin" field), which a downstream parser accepts as legitimate.

Impact

For an application that uses untrusted field names/filenames:

  • Field injection / override (integrity). Inject or override fields the backend trusts (e.g. is_admin, role) — the primary demonstrated impact.
  • Header injection into the generated multipart part.

Claims of guaranteed privilege escalation, authentication bypass, high confidentiality impact, and availability impact are application-dependent downstream consequences, not properties of form-data itself, and are not demonstrated by the PoC.

Severity

The demonstrated, library-attributable impact is integrity (field/header injection); there is no demonstrated confidentiality disclosure or availability impact in form-data itself, and exploitation requires the consuming app to feed untrusted data into field names/filenames. A Moderate (≈5.3, I:L) rating is also defensible given that precondition.

Patch

Fixed in 4.0.6, 3.0.5, and 2.5.6. Users on older 0.x/1.x/2.x releases should upgrade to 2.5.6 or later.

The fix escapes \r, \n, and " as %0D, %0A, and %22 in field names and filenames, matching the WHATWG HTML multipart/form-data encoding algorithm that browsers implement. This neutralizes the injection while leaving ordinary field names (including name[0], dotted, and unicode names) unchanged.

Workaround

Until upgrading, validate or reject field names/filenames that contain control characters before calling append:

if (/[\r\n]/.test(field)) { throw new Error('invalid field name'); }

Credit

Reported by yueyueL.

References

https://github.com/form-data/form-data/security/advisories/GHSA-hmw2-7cc7-3qxxexploit, vendor-advisory, web
https://github.com/form-data/form-data/commit/64190db548c0179e37206858e39f27cf513e9435patch, web
https://github.com/form-data/form-data/commit/be3f3cf553978bac15a5182f1f3c3d2d38ccf229patch, web
https://github.com/form-data/form-data/commit/c7133499c2ee1b80c678e411244f4442bf902045patch, web
https://www.npmjs.com/package/form-dataproduct, web
https://cwe.mitre.org/data/definitions/93.htmltechnical-description
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-datatechnical-description, web
https://access.redhat.com/security/cve/CVE-2026-12143vdb-entry
https://bugzilla.redhat.com/show_bug.cgi?id=2488480issue-tracking
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-12143.json
https://access.redhat.com/errata/RHSA-2026:59136vendor-advisory
https://access.redhat.com/errata/RHSA-2026:48151vendor-advisory

Sources

SourceRecordLicence
CVE ListCVE-2026-12143 changed 2026-09-11CVE Terms of Use
GitHub Advisory DatabaseGHSA-hmw2-7cc7-3qxx changed 2026-09-10CC-BY-4.0
NVDCVE-2026-12143 changed 2026-09-11Public domain