Skip to content
GHSA Hxh7 Q3v4 R388

GHSA Hxh7 Q3v4 R388

github.com • December 3, 2026

Axios versions 0.27.0 through 0.34.0 and 1.0.0 through 1.20.0 contain an uncontrolled resource-consumption issue in request serialization. When a top-level object key ends in [], Axios treats its value as array-like and trusts any numeric length. A small attacker-controlled object can therefore cause Axios to allocate and populate an extremely large JavaScript array synchronously.

Exploitation requires an application to pass attacker-influenced object structure into an affected Axios serializer. In Node.js this can terminate the application process through heap exhaustion; in browsers it can block the main thread and may terminate the renderer.

A remotely supplied payload can cause service-wide denial of service when an application forwards it into Axios without validating its structure. The allocation happens before adapter dispatch, so Axios timeouts, response-size limits, and network-layer controls do not mitigate it.

The same JavaScript serializer is used in browser builds, where exploitation can cause a prolonged main-thread freeze or renderer termination depending on available memory and engine limits.

There is no demonstrated confidentiality or integrity impact. Merely installing Axios is insufficient: applications that never serialize untrusted objects through the affected paths are not exploitable.

Affected Functionality

The vulnerable sink is Axios's default toFormData visitor and utils.toArray.

Affected paths include:

axios.toFormData() beginning with v0.27.0.

Automatic multipart body serialization when an object is sent with Content-Type: multipart/form-data, including postForm, putForm, and patchForm.

Beginning with v0.28.0, default query-parameter serialization through AxiosURLSearchParams, including axios.getUri() and ordinary requests with an object-valued params.

Beginning with v0.28.0, automatic application/x-www-form-urlencoded body serialization.

The trigger requires a top-level key ending in [] whose value exposes a numeric length. JSON serialization, caller-provided custom serializers, already-constructed FormData/URLSearchParams, and inputs validated to contain actual bounded arrays do not take the vulnerable conversion path.

The default visitor in lib/helpers/toFormData.js recognizes top-level keys ending in [] and passes their values to utils.toArray().

utils.toArray() reads the supplied length, allocates new Array(length), and writes every index:

Writing each index materializes the array even when the source object has no indexed properties. There is no bound on length, so {length: 50000000} can consume hundreds of megabytes despite being represented by only a few input bytes.

The formSerializer.maxDepth and paramsSerializer.maxDepth options constrain recursive depth, not array-like length or serializer width, and therefore do not prevent this attack.

Fixed in 0.35.0 and 1.21.0, which reject a declared length unless the object has that many index properties.

Proof of Concept of Attack

The following constrained PoC runs the vulnerable operation in a child process with a 64 MB V8 heap and makes no network request. Save it as poc.mjs in an affected Axios checkout:

On Unix-like systems, run it with core dumps disabled:

Expected result: serialization starts, the child exits non-zero or with SIGABRT, an allocation failure is detected, and serialization-completed is absent. Changing length to 10 completes normally.

On v0.28.0 or later, the default query serializer can be demonstrated without networking by replacing the axios.toFormData() call with:

Validate top-level values whose keys end in []. Require actual arrays or trusted FileList objects and enforce an application-specific maximum length before calling Axios.

Construct FormData or URLSearchParams explicitly rather than passing an untrusted object to automatic serialization.

Supply a custom paramsSerializer.serialize implementation for attacker-influenced query objects.

Remove or normalize attacker-controlled top-level [] suffixes when that notation is not required.

Axios timeouts and maxDepth do not mitigate this issue.

Axios's default multipart serializer accepts an arbitrary object as an array-like value when its top-level key ends in [] . The serializer trusts the object's numeric length , allocates a JavaScript array of that length, and writes every index before applying any limit. A small JSON-shaped input can therefore cause synchronous heap exhaustion before Axios sends a request.

Axios automatically converts object request bodies to FormData when the effective content type contains multipart/form-data . The default visitor in lib/helpers/toFormData.js gives special meaning to a top-level key ending in [] :

utils.toArray() in lib/utils.js accepts any truthy object whose length is a number:

There is no upper bound on length . For an attacker-selected value such as one billion, Axios creates an array with one billion slots and then assigns to each slot synchronously. Assigning every index materializes the array rather than leaving it sparse, quickly exhausting available heap.

The input does not require a native array, FileList, custom prototype, or caller-supplied code. It is ordinary JSON-shaped data forwarded under a multipart field name ending in [] .

The failure happens during Axios's default request transformation, before adapter dispatch or any network connection. Network timeouts and response limits therefore do not mitigate it.

Run the following from the Axios repository root.

Ensure Docker is running.

Change into the root of the affected Axios checkout.

Run the command in the POC script section.

Observe the serialization-started marker.

Observe repeated garbage-collection activity followed by a fatal heap allocation error.

Confirm that serialization-completed is never printed and no network request is required.

Reduce length to a small value, such as 10 , to confirm that serialization completes and the request then reaches the adapter.

An application that forwards an untrusted object into an Axios multipart request can be terminated by a very small input if the application uses, preserves, or constructs a top-level field name ending in [] .

In a Node.js service, heap exhaustion terminates the process and disrupts every request it serves. In a browser, the same synchronous allocation can freeze or crash the renderer. The allocation occurs before network-level controls apply.

Exploitation requires an application data flow that allows an attacker to influence the array-like object's length and places it beneath a multipart key ending in []

Reported by depthfirst (Pranjali Thakur - pranjali@depthfirst.com )

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.

Three Axios DoS Advisories: Heap Exhaustion, Event-Loop Starvation, and Process Crash Three GitHub security advisories published 2026-12-03 describe denial-of-service issues in the Axios HTTP client for JavaScript. The first (GHSA-hxh7-q3v4-r388) affects Axios 0.27.0 through 0.34.0 and 1.0.0 through 1.20.0: when a top-level object key ends in [], the request serializer trusts an attacker-supplied numeric length and synchronously allocates a very large array, which can exhaust heap memory and terminate a Node.js process or freeze a browser main thread. The second (GHSA-r7r7-378m-mqq3) affects Axios 1.0.0 through 1.20.0 in the Node.js HTTP adapter's bandwidth limiter: a positive maxRate below 2 bytes per second can cause the same chunk to be rescheduled repeatedly via process.nextTick(), starving the event loop; the advisory states this is unusual configuration and browser and fetch adapters are not affected. The third (GHSA-6746-99mh-37fc) concerns the fetch adapter: a truthy non-callable inherited value causes an asynchronous uncaught TypeError that can terminate a Node.js process when a real AbortSignal is supplied and signal cleanup is reached. The advisory states exploitation requires the application to pass attacker-influenced input into the affected path; installing Axios alone is insufficient. The first advisory states the allocation occurs before adapter dispatch, so timeouts and response-size limits do not mitigate it. The third advisory states arbitrary code execution is not demonstrated by Axios alone. No confidentiality or integrity impact is identified in any of the three advisories. Fixed versions and CVE identifiers are not stated in the provided text. 49

Extracted Entities

Attack Types (1)

Domains (1)

Platforms (2)