The vulnerability, CVE-2026-40175, is a CRLF injection weakness in the Axios library. The root cause is improper neutralization of CRLF sequences in HTTP headers. This allows an attacker, who can pollute the Object.prototype through another vulnerability in a separate library, to inject malicious headers into requests made by Axios. This can lead to HTTP Request Smuggling, enabling attacks like cache poisoning, session hijacking, or, in this specific case, bypassing security controls for cloud metadata services like AWS IMDSv2.
The investigation of the provided patch commit 363185461b90b1b78845dc8a99a1f103d9b122a1 reveals that the core changes were made in lib/core/AxiosHeaders.js. The AxiosHeaders.set method is the primary function responsible for setting headers. Before the patch, it lacked proper validation for CRLF characters. The fix was to introduce a new validation function, assertValidHeaderValue, and call it from within AxiosHeaders.set for every header being set. This ensures that any header value containing CRLF characters will be rejected, thus preventing the injection.
The normalizeValue function was also part of the vulnerable code path, as its logic to strip only trailing CRLF characters was insufficient. While it was modified, the main fix is the proactive validation in the set method. Therefore, any runtime profile during exploitation would involve the AxiosHeaders.set function processing a maliciously crafted header value originating from a polluted prototype.