CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-42041

CVE-2026-42041: Prototype Pollution Gadget in Axios Leading to Authentication Bypass

Amit Schendel
Amit Schendel
Senior Security Researcher

May 5, 2026·5 min read·20 visits

Executive Summary (TL;DR)

A flaw in the Axios configuration merging process allows a polluted Object prototype to overwrite the `validateStatus` function. This causes the client to treat 4xx and 5xx error responses as successful, potentially bypassing authentication and error-handling checks.

Axios versions prior to 1.15.1 and 0.31.1 contain a prototype pollution gadget in the configuration merging logic. This vulnerability allows an attacker to bypass authentication mechanisms by leveraging a separate prototype pollution flaw to manipulate the HTTP response validation process.

Vulnerability Overview

Axios is a widely adopted promise-based HTTP client for Node.js and the browser. The library employs a configuration merging system to combine global defaults with per-request configuration objects. This mechanism processes properties like headers, base URLs, and response validation functions.

The vulnerability exists within the lib/core/mergeConfig.js module, specifically affecting how certain direct configuration keys are merged. Axios assigned the validateStatus property to a merging strategy that utilized the JavaScript in operator. This operator inherently traverses the object prototype chain during property existence checks.

Because the in operator evaluates properties on the prototype, Axios acts as a prototype pollution gadget. If an attacker pollutes the global Object.prototype via an independent vulnerability, Axios will adopt the polluted properties during configuration merging. This transforms a generic prototype pollution flaw into a specific application logic bypass.

Root Cause Analysis

The root cause of CVE-2026-42041 is the insecure implementation of the mergeDirectKeys strategy within the Axios configuration merging engine. Axios utilizes distinct strategies to handle different types of configuration data. The validateStatus property dictates whether an HTTP response is treated as a success or failure, and it is processed using mergeDirectKeys.

The mergeDirectKeys function originally relied on the JavaScript in operator to determine if a property was supplied in the user's configuration object. The in operator returns true if a property exists directly on the object or anywhere within its prototype chain. This design choice introduced a severe side effect when the global prototype is modified.

When prop in config2 is evaluated, the JavaScript engine checks config2 for the validateStatus property. If the property is absent from config2, the engine inspects Object.prototype. If an attacker has polluted Object.prototype.validateStatus, the in operator returns true, and Axios assigns the malicious function as the active response validator.

Code Analysis

The vulnerability manifests in the mergeDirectKeys function located in lib/core/mergeConfig.js. The original code evaluated property existence using the in operator, which exposed the logic to prototype chain pollution.

// Vulnerable Implementation (lib/core/mergeConfig.js)
function mergeDirectKeys(config1, config2) {
  // ...
  if (prop in config2) { // Traverses the prototype chain
    return getMergedValue(config1[prop], config2[prop]);
  }
  // ...
}

The patched implementation replaces the in operator with Object.prototype.hasOwnProperty.call(). This method strictly checks for properties defined directly on the object, ignoring properties inherited through the prototype chain.

// Patched Implementation (lib/core/mergeConfig.js)
function mergeDirectKeys(config1, config2) {
  // ...
  if (Object.prototype.hasOwnProperty.call(config2, prop)) { // Ignores prototype
    return getMergedValue(config1[prop], config2[prop]);
  }
  // ...
}

This fix is complete for the mergeDirectKeys strategy. It effectively neutralizes the specific gadget chain involving validateStatus. Security researchers should note that other JavaScript libraries employing the in operator for configuration merging remain susceptible to similar gadget behavior.

Exploitation Methodology

Exploitation requires a pre-existing prototype pollution vulnerability within the target application or its dependencies. The attacker first identifies an entry point, such as a vulnerable deep-merge function or JSON parser, to pollute the global prototype.

The attacker injects a payload that assigns a permissive function to the validateStatus property on Object.prototype. A standard payload sets this property to a function that always returns true, such as Object.prototype.validateStatus = () => true;. This function instructs Axios to accept any HTTP status code as a successful response.

Axios relies on lib/core/settle.js to process responses. The settle module executes the validateStatus function to determine if the Promise should be resolved or rejected. With the polluted function active, settle.js resolves the Promise regardless of the actual server response code.

// lib/core/settle.js execution flow
if (!validateStatus || validateStatus(response.status)) {
  resolve(response); // Attacker payload forces this branch to execute
} else {
  reject(new AxiosError(...));
}

Impact Assessment

The CVSS v3.1 base score for this vulnerability is 4.8 (Medium), reflecting the high attack complexity. The vulnerability cannot be exploited in isolation; it functions purely as an amplifier for an existing prototype pollution flaw. Despite the medium score, the practical impact on application security can be critical.

Applications frequently use Axios interceptors to enforce authentication and authorization controls. A common pattern involves catching 401 Unauthorized or 403 Forbidden responses to trigger a logout process or token refresh. The prototype pollution gadget bypasses this logic entirely by masking the error response.

When a 401 response is silently converted into a resolved Promise, the application processes the empty or error-formatted response body as legitimate data. This leads to undefined application states, logic errors, or unauthorized access to restricted client-side views. The vulnerability severely compromises the integrity of the client-side state machine.

Remediation and Mitigation

The primary remediation strategy is upgrading Axios to a patched version. Developers must update their dependencies to Axios version 1.15.1 or 0.31.1. Upgrading removes the insecure in operator from the configuration merging logic.

If immediate patching is not feasible, developers can implement a functional workaround. By explicitly defining a validateStatus function at the global Axios instance level, the application shadows the prototype chain. This prevents the JavaScript engine from traversing up to the polluted Object.prototype.

A secondary defense-in-depth measure involves auditing the application and its dependency tree for primary prototype pollution vulnerabilities. Addressing the root cause of the prototype pollution eliminates the prerequisite for this gadget. Development teams should employ dependency scanning tools and enforce strict input validation on all functions that recursively process object properties.

Technical Appendix

CVSS Score
4.8/ 10
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
EPSS Probability
0.09%
Top 75% most exploited

Affected Systems

Axios (Node.js HTTP client)Axios (Browser HTTP client)

Affected Versions Detail

Product
Affected Versions
Fixed Version
Axios
Axios
< 0.31.10.31.1
Axios
Axios
>= 1.0.0, < 1.15.11.15.1
AttributeDetail
Vulnerability ClassPrototype Pollution Gadget (CWE-1321)
Attack VectorNetwork-based (Requires prior pollution)
CVSS v3.1 Score4.8 (Medium)
EPSS Score0.00088 (24.91%)
Primary ImpactAuthentication Bypass / Logic Flaw
Exploit StatusProof of Concept available

MITRE ATT&CK Mapping

T1078Valid Accounts
Defense Evasion
T1190Exploit Public-Facing Application
Initial Access
CWE-1321
Prototype Pollution

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

Vulnerability Timeline

Vulnerability publicly disclosed and CVE assigned
2026-04-24
GitHub Advisory GHSA-w9j2-pvgh-6h63 published
2026-04-24
Fixed versions 1.15.1 and 0.31.1 released
2026-04-24

References & Sources

  • [1]GitHub Security Advisory GHSA-w9j2-pvgh-6h63
  • [2]NVD Vulnerability Detail CVE-2026-42041
  • [3]Snyk Vulnerability Database Analysis
  • [4]Axios Threat Model

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 2 hours ago•GHSA-C7JM-38GQ-H67H
8.1

GHSA-C7JM-38GQ-H67H: Authentication Bypass via Replay Attack in http4k-security-digest due to Insecure Default Nonce Verifier

The http4k-security-digest module within the http4k library fails to validate HTTP Digest Access Authentication nonces by default. Due to an always-true nonce verifier lambda implementation, applications using default configurations do not enforce session freshness or uniqueness. This design flaw allows remote attackers to perform replay attacks, gaining unauthorized access to protected endpoints by intercepting and retransmitting valid authorization headers.

Amit Schendel
Amit Schendel
3 views•5 min read
•about 2 hours ago•CVE-2026-11769
6.4

CVE-2026-11769: Local File Read and Privilege Escalation in Grafana Operator via Jsonnet Evaluation

CVE-2026-11769 is a directory traversal vulnerability affecting the Grafana Operator before version 5.24.0. An authenticated attacker with basic namespace privileges can deploy a crafted GrafanaDashboard or GrafanaLibraryPanel custom resource to read sensitive local files. This enables the extraction of the service account token of the operator manager, resulting in cluster-wide privilege escalation.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 3 hours ago•CVE-2026-53725
5.9

CVE-2026-53725: Sensitive Information Disclosure via MFA Re-fetch Bypass in Parse Server

CVE-2026-53725 is a critical sensitive information disclosure vulnerability in Parse Server (versions 9.8.0 to < 9.9.1-alpha.5). When Multi-Factor Authentication (MFA) is enabled and standard read permissions on the _User class are restricted via Class-Level Permissions (CLPs), the /login and /verifyPassword endpoints improperly fall back to returning the raw database row upon a failed mock re-fetch request. This behavior leaks plaintext MFA TOTP secrets, recovery codes, and fields designated as protected, enabling attackers with compromised user passwords to bypass multi-factor authentication controls entirely.

Alon Barad
Alon Barad
2 views•8 min read
•about 3 hours ago•CVE-2026-53726
6.9

CVE-2026-53726: Authorization Bypass in Parse Server Relation Queries ($relatedTo)

Parse Server prior to versions 8.6.80 and 9.9.1-alpha.6 contains an authorization bypass vulnerability in its relation query handling. A database query utilizing the `$relatedTo` operator can read the membership details of a Relation field even when that field is hidden via `protectedFields` or restricted by object-level Access Control Lists (ACLs).

Amit Schendel
Amit Schendel
3 views•9 min read
•about 4 hours ago•GHSA-9GGV-8W38-R7PM
8.1

GHSA-9GGV-8W38-R7PM: SQL Injection in TypeORM UpdateQueryBuilder and SoftDeleteQueryBuilder

A critical SQL injection vulnerability was discovered in TypeORM's UpdateQueryBuilder and SoftDeleteQueryBuilder when targeting MySQL and MariaDB backends. The flaw allows unauthenticated remote attackers to execute arbitrary SQL commands because input validation was bypassed on certain method signatures. The initial patch was incomplete, leaving a bypass open, which was resolved in the final security update.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 4 hours ago•GHSA-C3WQ-J5VH-68RC
6.0

GHSA-C3WQ-J5VH-68RC: Hugo Symlink Confinement Bypass in os.ReadFile

Hugo versions v0.123.0 through v0.163.0 are vulnerable to a directory confinement bypass. A regression in the virtual filesystem layer causes symbolic links to be followed during template execution, allowing templates to read arbitrary host files.

Amit Schendel
Amit Schendel
4 views•5 min read