REDHAT-BUG-2542584: High severity npm/axios vulnerability
Axios is a promise-based HTTP client for the browser and Node.js. From 1.15.2 until 1.20.0, the Node HTTP adapter in lib/adapters/http.js supplies request options without an own createConnection value. A separate same-process prototype-pollution flaw places a function on Object.prototype.createConnection. Node resolves and invokes the inherited createConnection socket factory, allowing the attacker-controlled function to select the transport endpoint. The attacker endpoint can receive request headers and bodies, including credentials, and return attacker-controlled responses while the URL appears legitimate. This issue is fixed in version 1.20.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
axiosto a version that resolves this vulnerability.Fixed in 1.20.0
Event History
Frequently Asked Questions
Which deployments are exposed?
The issue affects Axios usage through its Node.js HTTP adapter. Browser-only Axios use is not described as affected.
What must an attacker be able to do to exploit this?
An attacker needs a separate same-process prototype-pollution condition that can place a function on Object.prototype.createConnection. That inherited function is then invoked as the socket factory for Axios requests.
What is the impact of successful exploitation?
The attacker-controlled socket factory can redirect requests to an attacker endpoint, exposing request headers and bodies, including credentials. It can also return attacker-controlled responses even though the request URL appears legitimate.
How can this be remediated?
Upgrade Axios to version 1.20.0, which fixes this issue. The affected versions begin at 1.15.2 and extend until the fixed release.