<?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 — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/axios/</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>Wed, 03 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/axios/feed.xml" rel="self" type="application/rss+xml"/><item><title>Axios Prototype Pollution Vulnerability Leads to Request Hijacking and Data Exfiltration</title><link>https://feed.craftedsignal.io/briefs/2024-01-03-axios-prototype-pollution/</link><pubDate>Wed, 03 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-03-axios-prototype-pollution/</guid><description>Axios versions 0.19.0 through 1.13.6 are vulnerable to prototype pollution, allowing attackers to intercept and modify JSON responses, hijack HTTP requests, and exfiltrate sensitive data by polluting the Object.prototype with keys like `parseReviver` and `transport`.</description><content:encoded><![CDATA[<p>Axios, a popular HTTP client library, is vulnerable to prototype pollution attacks affecting versions 0.19.0 through 1.13.6. This vulnerability arises from the insecure merging of configuration options within the <code>mergeConfig</code> function, which lacks proper checks for own properties. By polluting the <code>Object.prototype</code> with malicious keys, such as <code>parseReviver</code> and <code>transport</code>, attackers can inject code into the request processing flow. This allows for the interception and modification of JSON responses before they reach the application, as well as full hijacking of HTTP requests, exposing sensitive information like credentials, headers, and request bodies. Successful exploitation requires a separate source of prototype pollution within the same process, such as a vulnerable version of lodash ( &lt; 4.17.21).</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker exploits a separate prototype pollution vulnerability (e.g., in lodash &lt; 4.17.21) to pollute the <code>Object.prototype</code> with a malicious <code>parseReviver</code> or <code>transport</code> property.</li>
<li>The application initiates an HTTP request using Axios.</li>
<li>Axios&rsquo; <code>mergeConfig</code> function merges the default configurations with the request-specific configurations without properly checking for own properties.</li>
<li>Due to the prototype pollution, the malicious <code>parseReviver</code> or <code>transport</code> property from <code>Object.prototype</code> is used in the merged configuration.</li>
<li>If <code>parseReviver</code> is polluted, the <code>JSON.parse</code> function within Axios uses the malicious reviver function, allowing the attacker to inspect and modify the response body. This could lead to data exfiltration or tampering with application logic.</li>
<li>If <code>transport</code> is polluted, Axios uses the attacker-controlled transport object for the HTTP request, granting the attacker full access to request details (URL, headers, credentials).</li>
<li>The attacker logs or forwards the intercepted request data (credentials, headers, body) to an external attacker-controlled server.</li>
<li>The hijacked request proceeds normally, and the application receives the (potentially modified) response.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this prototype pollution vulnerability can have severe consequences. Attackers can silently modify JSON responses, leading to data corruption or unauthorized privilege escalation within the application. Full HTTP request hijacking enables the exfiltration of sensitive information, including API keys, user credentials, and other confidential data transmitted in headers or the request body. Applications relying on Axios for secure communication are vulnerable, potentially affecting numerous users and services. This vulnerability affects applications using Axios versions 0.19.0 through 1.13.6 and using the Node.js http adapter.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to a patched version of Axios that addresses the prototype pollution vulnerability.  However, the advisory states that PR #7369 does not fully resolve the vulnerability and further patches are required.</li>
<li>As a temporary mitigation, sanitize or filter user-supplied input to prevent prototype pollution attacks affecting <code>Object.prototype</code>, particularly if using libraries like lodash &lt; 4.17.21.</li>
<li>Deploy the Sigma rule <code>Detect Axios HTTP Transport Hijacking</code> to identify potential attempts to hijack HTTP requests via prototype pollution.</li>
<li>Enable detailed logging for HTTP requests and responses to facilitate the detection of unusual data modifications or suspicious network activity.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>prototype-pollution</category><category>request-hijacking</category><category>data-exfiltration</category><category>axios</category><category>javascript</category></item></channel></rss>