Skip to main content

CVE-2026-42034 — Vulnerability in axios — CVE Details

MEDIUM

Axios' HTTP adapter-streamed uploads bypass maxBodyLength when maxRedirects: 0

Published May 5, 2026Updated September 10, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.50%). Schedule for your next planned update.

Does your project use an affected axios version?

Paste your package-lock.json to check it for CVE-2026-42034 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my package-lock.json

Summary

Summary

For stream request bodies, maxBodyLength is bypassed when maxRedirects is set to 0 (native http/https transport path). Oversized streamed uploads are sent fully even when the caller sets strict body limits.

Details

Relevant flow in lib/adapters/http.js:

  • 556-564: maxBodyLength check applies only to buffered/non-stream data.
  • 681-682: maxRedirects === 0 selects native http/https transport.
  • 694-699: options.maxBodyLength is set, but native transport does not enforce it.
  • 925-945: stream is piped directly to socket (data.pipe(req)) with no Axios byte counting.

This creates a path-specific bypass for streamed uploads.

PoC

Environment:

  • Axios main at commit f7a4ee2
  • Node v24.2.0

Steps:

  1. Start an HTTP server that counts uploaded bytes and returns {received}.
  2. Send a 2 MiB Readable stream with:
    • adapter: 'http'
    • maxBodyLength: 1024
    • maxRedirects: 0

Observed:

  • Request succeeds; server reports received: 2097152.

Control checks:

  • Same stream with default/nonzero redirects: rejected with ERR_FR_MAX_BODY_LENGTH_EXCEEDED.
  • Buffered body with maxRedirects: 0: rejected with ERR_BAD_REQUEST.

Impact

Type: DoS / uncontrolled upstream upload / resource exhaustion. Impacted: Node.js services using streamed request bodies with maxBodyLength expecting hard enforcement, especially when following Axios guidance to use maxRedirects: 0 for streams.

Advisory Timeline

  • First published May 5, 2026 (205 days ago).
  • Last revised September 10, 2026 — 128 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

npm
Update axios to 1.15.1 or later
npm install axios@1.15.1
npm
Update axios to 0.31.1 or later
npm install axios@0.31.1

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: npm (1).

PackageFixed In
axios npm · Affected: All versions1.15.1
axios npm · Affected: All versions0.31.1

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-770
    Allocation of Resources Without LimitsMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 5.3 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Frequently Asked Questions

What is CVE-2026-42034?
Axios' HTTP adapter-streamed uploads bypass maxBodyLength when maxRedirects: 0. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 5.3/10).
How do I check if my project is affected by CVE-2026-42034?
CVE-2026-42034 affects axios. It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-42034 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
5.3

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.50%
EPSS percentile: 35.6

This is a below-median EPSS score — only 35.6% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-5c9x-8gcm-mpgx

Related CVEs

  • CVE-2024-39338
    HIGH

    Server-Side Request Forgery in axios

  • CVE-2026-101903
    HIGH

    Axios: ReDoS in fromDataURI data: URL parser freezes the Node event loop (DoS)

  • CVE-2026-67319
    MEDIUM

    Axios: Nested axios option objects can consume polluted prototype values

  • CVE-2026-44490
    MEDIUM

    axios has DoS & Header Injection via Prototype Pollution Read-Side Gadgets in axios merge functions

  • CVE-2026-101902
    MEDIUM

    Axios: Prototype-Pollution Gadget in the Default Instance Allows Inherited Object.prototype.method to Override HTTP Method

  • CVE-2026-67314
    MEDIUM

    Axios: Prototype pollution auth subfields can inject Basic auth

  • CVE-2026-42042
    MEDIUM

    Axios: XSRF Token Cross-Origin Leakage via Prototype Pollution Gadget in `withXSRFToken` Boolean Coercion

  • CVE-2026-42040
    LOW

    Axios: Null Byte Injection via Reverse-Encoding in AxiosURLSearchParams

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my package-lock.json