CVE-2026-74866: @fastify/busboy vulnerable to CRLF injection via multipart Content-Disposition filename and name
@fastify/busboy is a multipart form-data parser for Node.js. Its multipart part-header parser splits header lines only on the two-byte carriage-return line-feed sequence, so a lone carriage return or line feed embedded in a part header is not treated as a line break and is carried verbatim into the parsed Content-Disposition filename and field name handed to the application. An attacker who uploads a file whose filename or field name contains a bare carriage return or line feed can inject control characters into consumers that trust the parser to return clean values, enabling filesystem filename pollution, log forging, or header injection when the value is forwarded to a carriage-return-sensitive sink. All versions of @fastify/busboy up to and including 3.2.1 are affected. The issue is fixed in version 3.2.2, which rejects any header line that still contains a bare carriage return or line feed. Users should upgrade to 3.2.2, and consumers such as @fastify/multipart should bump their @fastify/busboy dependency to pull in the fix.
Other sources
Impact
@fastify/busboy 3.2.1 and earlier retains a bare carriage return or line feed inside the parsed Content-Disposition parameters returned to the application. The multipart header parser ends a header line only on the two-byte \r\n sequence, so a lone CR or LF embedded in a part header is carried verbatim into the filename and field name delivered by the file and field events. An application that forwards the supplied filename or name into a CR/LF-sensitive sink cannot anticipate the embedded control character.
An attacker who uploads a file whose filename or field name contains a bare CR or LF can pollute filenames on disk when the upload is saved under its original name, inject forged lines into logs, or inject headers on a downstream hop that does not re-validate CR/LF, such as object-storage metadata or a proxied backend. Applications using @fastify/busboy directly, or through @fastify/multipart and its consumers, are affected.
Patches
Upgrade to @fastify/busboy 3.2.2 or later.
Workarounds
Validate or strip carriage return and line feed characters from the filename and field name before using them in any filesystem, logging, or outbound-header context.
— GitHub
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/@fastify/busboyto a version that resolves this vulnerability.Fixed in 3.2.2 - Upgrade
Upgrade
@fastify/busboyto a version that resolves this vulnerability.Fixed in 3.2.2 - Compensating control
Validate or strip carriage return and line feed characters from multipart filename and field name values before using them in filesystem, logging, or outbound-header contexts; consumers such as @fastify/multipart should bump their @fastify/busboy dependency to pull in the fix.
Event History
Frequently Asked Questions
Who can exploit this issue?
An unauthenticated remote attacker who can submit a multipart form-data upload can supply a filename or field name containing a bare carriage return or line feed. Exploitation depends on the application passing that parsed value to a carriage-return-sensitive consumer.
Are default installations affected?
Any application using @fastify/busboy version 3.2.1 or earlier is affected when it parses attacker-controlled multipart form-data. Impact occurs only if the resulting filename or field name is trusted by downstream code, such as filesystem, logging, or header-handling logic.
What should be done if an immediate upgrade is not possible?
Validate or reject carriage return and line feed characters in parsed multipart filenames and field names before using them in filesystem paths, logs, HTTP headers, or other sensitive sinks. Upgrade @fastify/busboy to 3.2.2 as soon as possible; users of consumers such as @fastify/multipart should update the dependency chain to obtain the fixed version.
How can I determine whether my application is affected?
Check whether the resolved @fastify/busboy version is 3.2.1 or earlier and whether the application accepts multipart uploads. Review downstream handling of parsed Content-Disposition filename and field-name values for use in filenames, logs, or HTTP headers without filtering bare carriage return or line feed characters.