CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-42037
5.30.06%

CVE-2026-42037: CRLF Injection in Axios Multipart Form Data Generation

Amit Schendel
Amit Schendel
Senior Security Researcher

May 5, 2026·5 min read·4 visits

PoC Available

Executive Summary (TL;DR)

Axios < 1.15.1 is vulnerable to CRLF injection within multipart/form-data bodies. Attackers controlling the MIME type of uploaded files can inject malicious headers or manipulate the body payload. Upgrading to 1.15.1 resolves the issue.

A CRLF injection vulnerability exists in Axios versions 1.0.0 through 1.15.0 when operating in a Node.js environment. The flaw allows attackers to inject arbitrary headers into multipart/form-data payloads due to improper sanitization of the file type property, bypassing native Node.js HTTP header protections.

Vulnerability Overview

The vulnerability, identified as CVE-2026-42037, resides in the popular axios HTTP client library when utilized within a Node.js environment. Specifically, the flaw affects the logic responsible for generating multipart/form-data payloads, a standard format for transmitting files and complex data structures over HTTP.

The core issue is a CWE-93 (Improper Neutralization of CRLF Sequences) vulnerability. When constructing the sub-headers for individual parts of a multipart message, axios extracts metadata from the input objects. If the input contains a Blob or File-like object, the library retrieves its .type property to specify the MIME type of the payload.

Because this property is processed without sanitization, an attacker can supply a crafted .type string containing carriage return and line feed (CRLF) characters. These characters serve as structural delimiters in the HTTP protocol. Injecting them allows the attacker to alter the intended structure of the multipart payload, leading to header injection within the request body.

Root Cause Analysis

The flaw is located in the FormDataPart constructor within lib/helpers/formDataToStream.js. During the construction of a multipart/form-data request, axios iterates over the entries provided in the user-supplied FormData object. The library dynamically builds the headers for each part before appending the actual data.

The vulnerability stems from the use of raw string concatenation to build these headers. The code accesses the .type property of a Blob or File object and appends it directly to the Content-Type definition. The lack of input validation or encoding means any control characters present in the .type string are passed unmodified into the final stream.

This behavior circumvents the native CRLF injection protections introduced in Node.js version 18. The built-in Node.js mitigations target the primary HTTP request headers passed to functions like http.request(). Because the axios multipart construction occurs entirely within the request payload, the underlying Node.js http module treats the generated boundaries and sub-headers as opaque body data, performing no sanitization.

Code Analysis

Prior to the patch, the vulnerable logic in lib/helpers/formDataToStream.js constructed the part headers using direct interpolation. The code assumed the .type property would only contain standard MIME type identifiers.

// Vulnerable Implementation
let headers = 'Content-Disposition: form-data; name="' + key + '"';
if (filename) {
  headers += '; filename="' + filename + '"';
}
headers += CRLF;
// The value.type is concatenated directly with a trailing CRLF
headers += 'Content-Type: ' + (value.type || 'application/octet-stream') + CRLF;

The fix introduced in version 1.15.1 implements a sanitization function to strip newline and carriage return characters from the input. This prevents the attacker from prematurely terminating the header section.

// Patched Implementation
// A helper function strips CRLF sequences globally
const sanitize = (str) => str ? str.replace(/[\r\n]/g, '') : '';
 
let headers = 'Content-Disposition: form-data; name="' + sanitize(key) + '"';
if (filename) {
  headers += '; filename="' + sanitize(filename) + '"';
}
headers += CRLF;
// The value.type is explicitly sanitized before concatenation
headers += 'Content-Type: ' + (sanitize(value.type) || 'application/octet-stream') + CRLF;

Exploitation and Attack Methodology

Exploitation requires an architecture where a server-side Node.js application uses axios to proxy or forward user-supplied files to another endpoint. The attacker must have control over the MIME type attribute of the uploaded file.

The attacker constructs a malicious payload by appending \r\n to the expected MIME type, followed by arbitrary HTTP headers. If the attacker wishes to manipulate the body of the specific multipart section, they inject an additional \r\n to complete the header block.

A proof-of-concept payload sets the .type property to image/jpeg\r\nInjected-Header: malicious-value\r\n\r\n[Malicious Content]. When processed by the vulnerable axios version, the resulting multipart segment includes the injected header and alters the payload content boundary. The target backend parsing this multipart stream interprets the injected values as legitimate sub-headers.

Impact Assessment

The vulnerability holds a CVSS v3.1 score of 5.3 (Medium), reflecting its limited scope but high exploitability under specific conditions. The attack vector is strictly bounded by the multipart/form-data payload structure, meaning attackers cannot inject headers into the main HTTP envelope, only into the sub-headers of the specific file part.

While this limitation prevents classic HTTP request smuggling attacks against edge proxies, it enables targeted attacks against internal APIs and parsers. If the downstream service relies on the integrity of the multipart sub-headers for authentication, routing, or processing logic, the attacker can bypass these controls.

The impact on confidentiality, integrity, and availability remains context-dependent. In a typical scenario, the attacker gains low-level integrity modification capabilities over the internal request structure. Exploitation does not result in direct remote code execution or data exfiltration without chaining with a secondary vulnerability in the target backend's multipart parsing logic.

Remediation Guidance

The primary remediation strategy is upgrading the axios dependency to version 1.15.1 or later. This version implements strict CRLF stripping on both the .type and .name properties during multipart form generation.

For environments where immediate upgrading is not feasible, developers must implement strict input validation on all file uploads. This involves verifying the user-provided MIME type against an allowlist of expected formats (e.g., image/jpeg, application/pdf) before passing the object to axios.

Security teams should review server-side proxy implementations to ensure untrusted metadata is not blindly trusted. Relying on client-provided MIME types is a known anti-pattern; applications should ideally infer file types using magic bytes or server-side analysis rather than trusting the user-supplied .type property.

Official Patches

Axios ProjectGitHub Security Advisory

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
EPSS Probability
0.06%
Top 81% most exploited

Affected Systems

Node.js environments utilizing Axios for HTTP requestsServer-side applications proxying file uploads via Axios

Affected Versions Detail

Product
Affected Versions
Fixed Version
axios
Axios Project
>= 1.0.0, < 1.15.11.15.1
AttributeDetail
CWE IDCWE-93
CVSS v3.1 Score5.3 (Medium)
Attack VectorNetwork
Exploit StatusProof of Concept
EPSS Score0.00061 (18.76%)
CISA KEVNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1565.001Data Manipulation: Stored Data Manipulation
Impact
CWE-93
Improper Neutralization of CRLF Sequences ('CRLF Injection')

The software uses CRLF (carriage return line feed) sequences to signify the end of an HTTP header line, but it does not properly neutralize CRLF characters in user-supplied input.

Vulnerability Timeline

Initial patch commits identified
2026-04-07
Security fixes for fetch adapter implemented
2026-04-08
Version 1.15.0 released with partial mitigations
2026-04-09
CVE-2026-42037 and GHSA-445q-vr5w-6q77 published
2026-04-24

References & Sources

  • [1]GitHub Advisory (GHSA-445q-vr5w-6q77)
  • [2]NVD Record
  • [3]Axios Changelog

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.