<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Axios (&lt;= 0.31.0) — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/axios--0.31.0/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 02 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/axios--0.31.0/feed.xml" rel="self" type="application/rss+xml"/><item><title>Axios HTTP Adapter Prototype Pollution Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2024-01-axios-prototype-pollution/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-axios-prototype-pollution/</guid><description>A prototype pollution vulnerability in the Axios HTTP adapter allows an attacker to inject arbitrary HTTP headers into outgoing requests by polluting the Object prototype with specific properties, leading to potential authentication bypass and privilege escalation.</description><content:encoded><![CDATA[<p>A prototype pollution gadget exists within the Axios HTTP adapter (specifically in <code>lib/adapters/http.js</code>) that enables attackers to inject arbitrary HTTP headers into outgoing HTTP requests. The vulnerability arises from Axios&rsquo;s reliance on duck-type checking of the data payload. If the <code>Object.prototype</code> is polluted with properties like <code>getHeaders</code>, <code>append</code>, <code>pipe</code>, <code>on</code>, <code>once</code>, and <code>Symbol.toStringTag</code>, Axios incorrectly identifies any plain object payload as a <code>FormData</code> instance. Consequently, Axios invokes the attacker-controlled <code>getHeaders()</code> function, merging the resulting headers into the outgoing request. The vulnerability affects Axios versions greater than or equal to 1.0.0 and less than 1.15.1, as well as versions 0.31.0 and earlier. Exploitation requires a prototype pollution primitive existing somewhere in the application&rsquo;s dependency chain. Successful exploitation can lead to authentication bypass, session fixation, privilege escalation, and IP spoofing.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The attacker identifies a prototype pollution vulnerability within a dependency used by the target application (e.g., using <code>lodash.merge</code>, <code>qs</code>, or <code>JSON5</code>).</li>
<li>The attacker injects malicious JavaScript code that pollutes the <code>Object.prototype</code> with the following properties and corresponding values: <code>Symbol.toStringTag</code> set to <code>'FormData'</code>, <code>append</code> as an empty function, <code>getHeaders</code> as a function returning attacker-controlled headers, <code>pipe</code> as a function, and <code>on</code> and <code>once</code> as functions that return <code>this</code>.</li>
<li>The target application uses Axios to make an HTTP request (POST, PUT, or PATCH) with a data payload.</li>
<li>Axios&rsquo;s <code>lib/adapters/http.js</code> processes the data payload and performs duck-type checks using <code>utils.isFormData</code> and <code>utils.isFunction(data.getHeaders)</code>.</li>
<li>Due to the prototype pollution, the <code>utils.isFormData</code> function incorrectly identifies the data payload as a FormData instance.</li>
<li>Axios then calls the attacker-controlled <code>getHeaders()</code> function.</li>
<li>The attacker&rsquo;s <code>getHeaders()</code> function returns a set of malicious HTTP headers.</li>
<li>Axios merges these malicious headers into the outgoing HTTP request, potentially overwriting or adding sensitive headers. The request is sent to the target server.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability can have significant consequences. Attackers can bypass authentication mechanisms by injecting arbitrary <code>Authorization</code> headers or escalate privileges by injecting <code>X-Role</code> or <code>X-User-ID</code> headers. Session fixation is also possible. IP spoofing and WAF bypass can also occur due to header injection. The potential impact could extend beyond a single service if Axios is used for service-to-service communication, where downstream services trust identity headers forwarded from upstream API gateways.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade Axios to a patched version (&gt;= 1.15.1 or &gt; 0.31.0) to remediate CVE-2026-42035.</li>
<li>Apply the provided patch to <code>lib/adapters/http.js</code> to include an explicit own-property check on <code>getHeaders</code> as a short-term mitigation.</li>
<li>Implement input validation and sanitization to prevent prototype pollution vulnerabilities in the application&rsquo;s dependencies, focusing on libraries like <code>lodash.merge</code>, <code>qs</code>, and <code>JSON5</code>.</li>
<li>Review and restrict the usage of deep-merge utilities that process attacker-controlled input to minimize the risk of prototype pollution.</li>
<li>If Axios is used in service-to-service communication, carefully evaluate the trust boundaries and the potential impact of injected headers on downstream services, considering a Scope Change as outlined in the advisory.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>prototype-pollution</category><category>header-injection</category><category>axios</category><category>cve-2026-42035</category><category>authentication-bypass</category><category>privilege-escalation</category></item></channel></rss>