CVE-2026-42041

Axios: Authentication Bypass via Prototype Pollution Gadget in `validateStatus` Merge Strategy

Published Apr 24, 2026 CVSS 3.1 · 4.8 Medium EPSS 1.1% KEV · Not listed
Description
Axios is a promise based HTTP client for the browser and Node.js. Prior to 1.15.1 and 0.31.1, the Axios library is vulnerable to a Prototype Pollution "Gadget" attack that allows any Object.prototype pollution to silently suppress all HTTP error responses (401, 403, 500, etc.), causing them to be treated as successful responses. This completely bypasses application-level authentication and error handling. The root cause is that validateStatus is the only config property using the mergeDirectKeys merge strategy, which uses JavaScript's in operator — an operator that inherently traverses the prototype chain. When Object.prototype.validateStatus is polluted with () => true, all HTTP status codes are accepted as success. This vulnerability is fixed in 1.15.1 and 0.31.1.

Analysis

AI-generated

Technical impact

Axios, a widely used HTTP client, contains an object prototype pollution flaw that lets an attacker overwrite Object.prototype.validateStatus with a function that always returns true. This causes Axios to treat every HTTP status code as a successful response, silently bypassing error handling and application‑level authentication. The result is that protected resources may be accessed without proper credential verification while the attacker remains invisible to normal error‑logging or monitoring pipelines. The weakness involves improper handling of prototype chains (CWE-1321), inadequate authentication checks (CWE-287), and exploitation through property mutation that escalates privileges (CWE-915).

Affected Systems

Vulnerable versions of the Axios library are those older than 1.15.1 for Node.js and older than 0.31.1 for browser environments. Any project that imports or requires those legacy packages is at risk, regardless of the surrounding infrastructure.

Risk and Exploitability

The CVSS score of 4.8 indicates moderate severity; the EPSS score of less than 1% shows that exploitation is unlikely to be prolific, and the vulnerability is not currently listed in CISA’s KEV catalog. Based on the description, the likely attack vector involves executing arbitrary JavaScript in an environment that imports Axios, so it is most relevant to web applications, server‑side scripting, or any environment where client code can influence server requests. If the attacker can manipulate Object.prototype—common in environments that serve or process untrusted input—then the prototype‑pollution gadget will be triggered, flattening error codes and enabling unauthorized access.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Axios library to version 1.15.1 (Node) or 0.31.1 (browser) which removes the vulnerable merge strategy.
  • If an upgrade is not immediately possible, avoid setting or relying on the validateStatus property, and instead explicitly check response.status for codes that indicate success.
  • As a temporary defence, ensure that the runtime environment sanitises Object.prototype and prohibits modifications from untrusted code, or isolate Axios usage within a trusted sandbox.

Generated by OpenCVE AI on May 6, 2026 at 01:53 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-w9j2-pvgh-6h63 Axios: Authentication Bypass via Prototype Pollution Gadget in `validateStatus` Merge Strategy
References
Link Providers
https://access.redhat.com/errata/RHSA-2026:14937 cve-icon
https://access.redhat.com/errata/RHSA-2026:16476 cve-icon
https://access.redhat.com/errata/RHSA-2026:16532 cve-icon
https://access.redhat.com/errata/RHSA-2026:16534 cve-icon
https://access.redhat.com/errata/RHSA-2026:16535 cve-icon
https://access.redhat.com/errata/RHSA-2026:16542 cve-icon
https://access.redhat.com/errata/RHSA-2026:16874 cve-icon
https://access.redhat.com/errata/RHSA-2026:17468 cve-icon
https://access.redhat.com/errata/RHSA-2026:17474 cve-icon
https://access.redhat.com/errata/RHSA-2026:17657 cve-icon
https://access.redhat.com/errata/RHSA-2026:17699 cve-icon
https://access.redhat.com/errata/RHSA-2026:19109 cve-icon
https://access.redhat.com/errata/RHSA-2026:19375 cve-icon
https://access.redhat.com/errata/RHSA-2026:20889 cve-icon
https://access.redhat.com/errata/RHSA-2026:20938 cve-icon
https://access.redhat.com/errata/RHSA-2026:21017 cve-icon
https://access.redhat.com/errata/RHSA-2026:21338 cve-icon
https://access.redhat.com/errata/RHSA-2026:21772 cve-icon
https://access.redhat.com/errata/RHSA-2026:22465 cve-icon
https://access.redhat.com/errata/RHSA-2026:22619 cve-icon
https://access.redhat.com/errata/RHSA-2026:22629 cve-icon
https://access.redhat.com/errata/RHSA-2026:22840 cve-icon
https://access.redhat.com/errata/RHSA-2026:23361 cve-icon
https://access.redhat.com/errata/RHSA-2026:24536 cve-icon
https://access.redhat.com/errata/RHSA-2026:24539 cve-icon
https://access.redhat.com/errata/RHSA-2026:24853 cve-icon
https://access.redhat.com/errata/RHSA-2026:24977 cve-icon
https://access.redhat.com/errata/RHSA-2026:25041 cve-icon
https://access.redhat.com/errata/RHSA-2026:25089 cve-icon
https://access.redhat.com/errata/RHSA-2026:25271 cve-icon
https://access.redhat.com/errata/RHSA-2026:25273 cve-icon
https://access.redhat.com/errata/RHSA-2026:26214 cve-icon
https://access.redhat.com/errata/RHSA-2026:26225 cve-icon
https://access.redhat.com/errata/RHSA-2026:26232 cve-icon
https://access.redhat.com/errata/RHSA-2026:33574 cve-icon
https://access.redhat.com/errata/RHSA-2026:36882 cve-icon
https://access.redhat.com/errata/RHSA-2026:50300 cve-icon
https://access.redhat.com/security/cve/CVE-2026-42041 cve-icon
https://bugzilla.redhat.com/show_bug.cgi?id=2461629 cve-icon
https://github.com/axios/axios/security/advisories/GHSA-w9j2-pvgh-6h63 cve-icon cve-icon cve-icon cve-icon
https://nvd.nist.gov/vuln/detail/CVE-2026-42041 cve-icon
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-42041.json cve-icon
https://www.cve.org/CVERecord?id=CVE-2026-42041 cve-icon
History
Type Values Removed Values Added
First Time appeared Axios
Axios axios
CPEs cpe:2.3:a:axios:axios:*:*:*:*:*:node.js:*:*
Vendors & Products Axios
Axios axios
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Axios is a promise based HTTP client for the browser and Node.js. Prior to 1.15.1 and 0.31.1, the Axios library is vulnerable to a Prototype Pollution "Gadget" attack that allows any Object.prototype pollution to silently suppress all HTTP error responses (401, 403, 500, etc.), causing them to be treated as successful responses. This completely bypasses application-level authentication and error handling. The root cause is that validateStatus is the only config property using the mergeDirectKeys merge strategy, which uses JavaScript's in operator — an operator that inherently traverses the prototype chain. When Object.prototype.validateStatus is polluted with () => true, all HTTP status codes are accepted as success. This vulnerability is fixed in 1.15.1 and 0.31.1.
Title Axios: Authentication Bypass via Prototype Pollution Gadget in `validateStatus` Merge Strategy
Weaknesses CWE-1321
CWE-287
References
Metrics cvssV3_1

{'score': 4.8, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N'}

Weaknesses
  • CWE-1321

    Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

  • CWE-287

    Improper Authentication

  • CWE-915

    Improperly Controlled Modification of Dynamically-Determined Object Attributes

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 10, 2026, 12:04 PM
Reserved
Apr 23, 2026, 4:05 PM
Status
Modified
Published
Apr 24, 2026, 6:16 PM
Modified
Nov 11, 2026, 11:10 PM
Severity
Important
Public date
Apr 24, 2026, 5:55 PM