Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Allocation of Resources Without Limits or Throttling vulnerabilities in an interactive lesson.
Start learningUpgrade axios to version 1.18.0 or higher.
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the getBodyLength() and resolveBodyLength() functions of lib/adapters/fetch.js, which lack a branch for WHATWG ReadableStream bodies, so the resolved length is undefined and the pre-dispatch maxBodyLength check is skipped. An attacker who controls a streamed request body can transmit uploads that exceed the configured maxBodyLength, causing unexpected outbound egress and consuming upstream API quota or bandwidth, by supplying a ReadableStream without a reliable Content-Length to a fetch-adapter request. Exploitation requires the fetch adapter, a body-bearing method such as POST, PUT, or PATCH, request data supplied as a ReadableStream without a reliable Content-Length, and a finite maxBodyLength, while the Node HTTP adapter and known-length bodies are unaffected.
This vulnerability can be avoided in Node.js by using the HTTP adapter (adapter: "http") for untrusted stream uploads, which enforces the stream body limit that the fetch adapter does not.