CRLF Injection Affecting form-data package, versions <2.5.6>=3.0.0 <3.0.5>=4.0.0 <4.0.6


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.39% (36th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about CRLF Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-FORMDATA-23775757
  • published5 Dec 2026
  • disclosed5 Dec 2026
  • creditYue (Knox) Liu

Introduced: 5 Dec 2026

NewCVE-2026-145492  (opens in a new tab)
CWE-93  (opens in a new tab)

How to fix?

Upgrade form-data to version 2.5.6, 3.0.5, 4.0.6 or higher.

Overview

Affected versions of this package are vulnerable to CRLF Injection via _multiPartHeader and _getContentDisposition in lib/form_data.js, which concatenate the field name and filename option directly into the Content-Disposition header without escaping CR (\r), LF (\n), or ". An attacker who controls the field name or filename passed to FormData#append can embed CRLF sequences and boundary strings to inject additional part headers or smuggle whole extra multipart parts into requests forwarded to a backend server, enabling field injection or override of trusted fields such as is_admin or role.

Note: This is only exploitable when the consuming application passes attacker-controlled data as a field name or filename to FormData#append.

Workaround

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

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

PoC

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.

Note: No environment (runtime version, OS, or configuration) is stated in the proof-of-concept section.

CVSS Base Scores

version 4.0
version 3.1