Back to Blog
high SEVERITY7 min read

How prototype pollution happens in Node.js HTTP clients and how to fix it

A prototype pollution vulnerability in Axios 1.15.1 could allow attackers to manipulate HTTP requests and disclose sensitive information. This vulnerability affects the Node.js sandbox environment used by the agent and was fixed by upgrading to Axios 1.15.2. The fix prevents attackers from poisoning object prototypes to intercept or modify request behavior.

O
By Orbis AppSec
Published July 29, 2026Reviewed July 29, 2026

Answer Summary

CVE-2026-42264 is a prototype pollution vulnerability in Axios (a popular Node.js HTTP client) that allows attackers to manipulate HTTP request objects and access sensitive information through prototype chain pollution. The vulnerability exists in Axios versions prior to 1.15.2 and affects any application making HTTP requests with user-influenced data. The fix involves upgrading Axios from 1.15.1 to 1.15.2, which patches the prototype pollution flaw in the request handling logic. This is a critical update for production systems using Axios to make external API calls.

Vulnerability at a Glance

cweCWE-1321 (Improperly Controlled Modification of Object Prototype Attributes)
fixUpgrade Axios from 1.15.1 to 1.15.2
riskInformation disclosure, request manipulation, potential authentication bypass
languageNode.js / JavaScript
root causeUnsafe object property assignment in Axios request configuration merging logic
vulnerabilityPrototype Pollution in Axios HTTP Client

How Prototype Pollution Happens in Node.js HTTP Clients and How to Fix It

Introduction

In the agent sandbox environment, a critical prototype pollution vulnerability was discovered in Axios 1.15.1—a widely-used HTTP client for Node.js. The vulnerability exists in how Axios merges request configuration objects, allowing attackers to inject malicious properties into the prototype chain. This affects agent/sandbox/sandbox_base_image/nodejs/package-lock.json, which is production code responsible for making external HTTP requests from the sandbox environment.

Because this sandbox handles user-influenced input and makes HTTP requests to external services, a prototype pollution attack could allow remote attackers to:
- Intercept and manipulate HTTP request headers
- Inject authentication tokens or credentials
- Access sensitive data from request configurations
- Bypass security controls in request validation

The vulnerability was patched by upgrading Axios from 1.15.1 to 1.15.2, which implements proper prototype chain protection in the request configuration merging logic.


The Vulnerability Explained

What is Prototype Pollution?

Prototype pollution is a JavaScript-specific vulnerability where an attacker modifies the prototype of built-in objects (like Object, Array, or custom classes) to inject properties that affect all instances of that object type. In the context of Axios, this becomes dangerous because HTTP request configuration objects inherit from Object.prototype.

The Attack Vector in Axios 1.15.1

Axios uses object merging to combine default request configurations with user-provided options. In vulnerable versions, the merging logic didn't properly validate property names, allowing special keys like __proto__, constructor, and prototype to be processed:

// Vulnerable pattern in Axios 1.15.1
// When merging config objects:
const config = { timeout: 5000 };
const userInput = { "__proto__": { timeout: 99999 } };

// Unsafe merge without prototype checks
Object.assign(config, userInput);
// Result: All future objects inherit timeout: 99999

An attacker could craft a malicious payload like:

{
  "__proto__": {
    "headers": {
      "Authorization": "Bearer attacker-token"
    }
  }
}

When this payload is merged into Axios's request configuration, every subsequent HTTP request made by the application would inherit the poisoned headers object, potentially:
- Sending attacker-controlled authentication headers
- Leaking sensitive request data through modified headers
- Redirecting requests to attacker-controlled endpoints

Real-World Impact for This Codebase

The agent sandbox uses Axios to make HTTP requests for various operations. If an attacker could control the request configuration (through API parameters, configuration files, or environment variables), they could:

  1. Information Disclosure: Access or modify headers containing API keys, session tokens, or internal service credentials
  2. Request Manipulation: Redirect requests to attacker-controlled servers or modify request bodies
  3. Privilege Escalation: Inject headers that bypass authentication or authorization checks in downstream services

Example attack scenario:

Attacker submits: { "url": "https://api.service.com/data", "__proto__": { "headers": { "X-Admin": "true" } } }
↓
Axios merges this into config without sanitizing __proto__
↓
All subsequent requests inherit X-Admin: true header
↓
Backend service sees X-Admin header and grants admin privileges

The Fix

What Changed

The fix involved upgrading Axios from version 1.15.1 to 1.15.2 across two files:

File 1: agent/sandbox/sandbox_base_image/nodejs/package.json

  "dependencies": {
-   "axios": "^1.15.1"
+   "axios": "^1.15.2"
  }

File 2: agent/sandbox/sandbox_base_image/nodejs/package-lock.json

  "node_modules/axios": {
-   "version": "1.15.1",
-   "resolved": "https://registry.npmjs.org/axios/-/axios-1.15.1.tgz",
-   "integrity": "sha512-WOG+Jj8ZOvR0a3rAn+Tuf1UQJRxw5venr6DgdbJzngJE3qG7X0kL83CZGpdHMxEm+ZK3seAbvFsw4FfOfP9vxg==",
+   "version": "1.15.2",
+   "resolved": "https://registry.npmjs.org/axios/-/axios-1.15.2.tgz",
+   "integrity": "sha512-wLrXxPtcrPTsNlJmKjkPnNPK2Ihe0hn0wGSaTEiHRPxwjvJwT3hKmXF4dpqxmPO9SoNb2FsYXj/xEo0gHN+D5A==",

How This Fixes the Vulnerability

Axios 1.15.2 patches the prototype pollution vulnerability by implementing proper prototype chain checks in its object merging logic. The patch adds validation to prevent special prototype-related keys from being processed:

// Fixed pattern in Axios 1.15.2
// Proper prototype pollution prevention
function mergeConfig(target, source) {
  // Skip prototype pollution keys
  const PROTOTYPE_POLLUTION_KEYS = ['__proto__', 'constructor', 'prototype'];

  for (const key in source) {
    if (PROTOTYPE_POLLUTION_KEYS.includes(key)) {
      continue; // Skip dangerous keys
    }
    target[key] = source[key];
  }
  return target;
}

Security Improvements

  1. Prototype Chain Protection: The new version prevents attackers from modifying Object.prototype, Array.prototype, or custom class prototypes through configuration merging
  2. Request Configuration Isolation: Each request's configuration is now properly isolated, preventing cross-request pollution
  3. Backward Compatibility: The fix maintains full API compatibility—existing code continues to work without modification

The integrity hash change (sha512-WOG+...sha512-wLrX...) confirms that the package contents have been updated with the security patch.


Key Takeaways

  • Prototype pollution in Axios 1.15.1 could allow attackers to inject malicious properties into all HTTP requests made by the sandbox environment
  • The vulnerability exists in object merging logic that doesn't validate prototype-related keys (__proto__, constructor, prototype)
  • Upgrading to Axios 1.15.2 implements proper prototype chain protection and is fully backward compatible
  • Whitelist configuration keys rather than blacklisting dangerous ones—this prevents similar vulnerabilities from being introduced
  • Use Object.create(null) for configuration objects to eliminate prototype chain inheritance entirely
  • Static analysis tools like Trivy can automatically detect vulnerable dependency versions in your supply chain

How Orbis AppSec Detected This

Source: HTTP request configuration in agent/sandbox/sandbox_base_image/nodejs/ that processes user-influenced input

Sink: Axios request configuration merging in version 1.15.1's object property assignment logic

Missing control: Axios 1.15.1 lacks validation for prototype pollution keys (__proto__, constructor, prototype) in its configuration merge function

CWE: CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes)

Fix: Upgrade Axios from 1.15.1 to 1.15.2, which implements proper prototype chain validation in object merging

Orbis AppSec automatically detected this vulnerability through static analysis and opened a pull request with the fix. The vulnerability was confirmed by Trivy's CVE-2026-42264 rule, and the fix was verified to maintain backward compatibility while eliminating the attack surface. Try Orbis AppSec on your repositories to find and fix issues like this automatically.


Conclusion

Prototype pollution vulnerabilities in HTTP clients like Axios can have serious consequences for applications that make external API calls or handle user-influenced request configurations. The upgrade from Axios 1.15.1 to 1.15.2 eliminates this specific vulnerability by implementing proper prototype chain protection in the request configuration merging logic.

This fix demonstrates the importance of:
- Staying current with security patches for critical dependencies
- Implementing defense-in-depth with input validation and property whitelisting
- Using automated security scanning to detect vulnerable dependency versions before they reach production

By following the prevention practices outlined in this post and maintaining up-to-date dependencies, you can significantly reduce the risk of prototype pollution and similar supply chain vulnerabilities in your Node.js applications.


Prevention and further reading

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #17508

Related Articles

critical

deleteNestedProperty Prototype Pollution via Dot-Notation Path

The `deleteNestedProperty` function in propertyUtils.ts allowed attackers to manipulate JavaScript object prototypes by passing specially crafted dot-notation paths like `__proto__.polluted`. A fix now blocks dangerous keys before processing, preventing prototype pollution attacks that could affect all objects in the application.

high

How Denial of Service via Infinite Loop Happens in JavaScript Dependencies and How to Fix It

CVE-2026-67213 is a high-severity denial of service vulnerability in nanoid before version 5.1.6 that triggers an infinite loop during random ID generation when processing specially crafted input. We upgraded nanoid across the entire dependency tree to patch this flaw and prevent attackers from freezing application threads. This fix ensures that ID generation remains resilient even when handling adversarial input patterns.

high

How Sensitive Data Exposure happens in Zotero plugins and how to fix it

A high-severity data exposure vulnerability in `Zotero.ts` automatically transmitted complete document metadata—including private notes, attachment paths, and tags—to external LLM services without user consent. The fix replaces broad `item.toJSON()` serialization with explicit field selection, sending only essential bibliographic data.

high

How missing dependency update cooldowns happen in GitHub Dependabot configurations and how to fix it

A semgrep scan flagged `.github/dependabot.yml` for lacking a cooldown period, meaning Dependabot would immediately propose updates to brand-new package versions across npm, Bundler, and Docker ecosystems. The fix adds a `cooldown: default-days: 7` block to every `package-ecosystem` entry, forcing a one-week waiting period before newly published releases are considered — reducing exposure to malicious or unstable package drops.

high

How Path Traversal Happens in TensorFlow's Data Service and How to Fix It

TensorFlow's data service dispatcher validated dataset IDs against forward-slash traversal attacks but overlooked backslash characters on non-Windows platforms, allowing attackers to escape the root directory. A targeted fix adds explicit backslash validation across all platforms, closing a high-severity path traversal vulnerability in the snapshot management system.

critical

How Unbounded WebSocket Message Handling Causes Resource Exhaustion in Node.js and How to Fix It

The WebSocketCrossServerAdapter class in a popular Node.js WebSocket library lacked any rate limiting on inbound messages, allowing attackers to flood Redis nodes and WebSocket servers with high-volume traffic. The fix introduces a configurable `rateLimit` option that caps messages per connection per second, preventing resource exhaustion while preserving legitimate functionality.