GHSA-mw39-9473-h7mr: 
JavaScript Analyse et atténuation de la vulnérabilité

Summary

Axios versions listed above can recurse without a depth limit while merging a plain-object params value. Method shortcuts such as axios.get() perform this merge before calling the public request() method. A sufficiently deep object therefore throws RangeError: Maximum call stack size exceeded before the shortcut returns a Promise. A remote attacker can cause a Node service outage if the service accepts a deeply nested object, forwards it as Axios params, and does not catch the synchronous exception. Other applications may experience only a failed request.

Impact

This is a runtime availability issue. In the tested Node HTTP handler, one unauthenticated request containing 30 KB of nested JSON caused an uncaught exception and process exit. An application or framework that catches the synchronous exception can keep the process running. A parser or schema that rejects excessive nesting also blocks the demonstrated input path. The error occurs during configuration merging, before the transport or serializer runs. The browser uses the shared merge code, but the demonstrated process-exit impact is specific to an uncaught exception in a Node service.

Affected Functionality

Plain-object params passed through Axios method shortcuts, including get() and other aliases that merge config before invoking request(), reach the vulnerable path. On 1.x, calling axios.request() directly returns a rejected Promise for the same input in my test; it still performs the unbounded merge. On 0.x, direct request() can also throw synchronously. The documented paramsSerializer.maxDepth limit does not protect this earlier merge step. Axios request configuration.

Technical Details

mergeConfig() deep-copies a plain-object params value. In utils.merge(), a nested plain object leads to another call to merge() with no depth bound. The method aliases call mergeConfig() before this.request(), so the async request() catch in modern 1.x cannot convert that alias-stage throw into a rejection. v1.19.0 merge configuration, merge helper, method aliases.

Proof of Concept of Attack

In a scratch directory with axios@1.19.0 installed, this local-only server parses attacker-supplied JSON and passes it to params. The stub adapter ensures no upstream network request occurs:

const http = require('http');
const axios = require('axios');
http.createServer((req, res) => {
  let body = '';
  req.on('data', chunk => { body += chunk; });
  req.on('end', () => {
    const params = JSON.parse(body);
    axios.get('http://127.0.0.1/', {
      params,
      adapter: config => Promise.resolve({
        data: 'ok', status: 200, statusText: 'OK', headers: {}, config
      })
    }).catch(() => res.end('caught-by-promise'));
  });
}).listen(3000, '127.0.0.1');

Send a 5,000-level JSON object to the loopback server:

python3 -c 'print("{\"x\":".repeat(5000) + "1" + "}".repeat(5000), end="")' |
  curl --data-binary @- http://127.0.0.1:3000/

The tested Node process exited with code 1 and a stack-overflow RangeError; caught-by-promise was not reached. The exact failing depth depends on the runtime stack size.

Workarounds

Reject excessive nesting in input before constructing Axios params. Also put a synchronous try/catch around affected method calls, or invoke them inside a Promise chain that catches synchronous throws. Error handling limits process-exit impact; input depth validation limits the underlying work. paramsSerializer.maxDepth alone is insufficient. <details> <summary><h3>Original report</h3></summary>

Summary

axios lets you send data with a request in an option called params. Before axios sends the request, it makes a copy of params. To copy it, axios goes into each layer of the object, one layer at a time. axios sets no limit on how many layers it will go into. An attacker sends a params object with thousands of layers inside layers. axios keeps going deeper until it runs out of memory for this task. It then throws an error and stops. The error happens before axios starts the network request. Because of this timing, the normal error handler (.catch()) never sees it. In Node.js, an error that nothing handles shuts down the whole program. So one small request from an unauthenticated user shuts down the server.

Details

Every axios request starts by joining two settings objects into one. This step copies the params value with a helper function named merge. merge copies an object by going into it layer by layer. For each object it finds inside, it calls itself again to copy that inner object. This repeat has no counter and no maximum depth. It continues until the program runs out of stack space. At that point Node.js throws:

RangeError: Maximum call stack size exceeded

Where this is in the code (axios@1.19.0, lib/utils.js):

result[targetKey] = merge({}, val);

merge then repeats for the next layer:

forEach(source, assignValue);

Two facts make this a server shutdown, not a normal error:

  1. The copy runs too early. axios copies params at the very start of axios.get(...), before it creates the promise. So the error is thrown straight out of axios.get(...). It is not turned into a failed promise. This is why a .catch() on the request cannot catch it.
  2. Nothing catches it. In Node.js, an unhandled error like this ends the process. Every request that the server was handling stops at the same time.

PoC

Environment: Node.js v24.18.0, axios@1.19.0 from npm. The result was the same in 5 of 5 runs.

Setup

npm init -y
npm pkg set type=module
npm install axios@1.19.0

poc.mjs

import http from 'node:http';
import axios from 'axios';
function buildDeep(depth) {
  const head = {};
  let cur = head;
  for (let i = 0; i < depth; i++) {
    cur.x = {};
    cur = cur.x;
  }
  return head;
}
// Realistic handler. It forwards user input as params.
// It relies on .catch(). No try/catch.
const server = http.createServer((req, res) => {
  if (req.url.startsWith('/attack')) {
    axios
      .get('http://127.0.0.1:1/upstream', {
        params: buildDeep(3000),
      })
      .then(() => res.end('ok'))
      .catch(() => res.end('caught-by-promise')); // does not run
    return;
  }
  res.end('alive');
});
server.listen(0, '127.0.0.1', () => {
  console.log('port', server.address().port);
});

Steps to reproduce

  1. Run:
    node poc.mjs
    It prints the port.
  2. Verify that the server is alive:
    curl http://127.0.0.1:<port>/health
    The server answers:
    alive
  3. Send one attack request:
    curl http://127.0.0.1:<port>/attack
  4. Try the health endpoint again:
    curl http://127.0.0.1:<port>/health
    There is no answer. The connection is refused.

Result

The process stops with exit code 1 and prints an uncaught:

RangeError: Maximum call stack size exceeded

The stack repeatedly contains:

merge → assignValue → merge → ...

The .catch() handler does not run.

Impact

  • A remote, unauthenticated user stops the Node.js process with one request.
  • The attack needs no credentials and no user interaction.
  • The payload is small — a few kilobytes of nested JSON.
  • A .catch() handler does not stop the error because the throw is synchronous.
  • All active connections on that process stop at the same moment.
  • The service stays down until an operator restarts it.
  • Any application that puts attacker-influenced data into params is affected, for example:
    axios.get(url, { params: req.query });

</details>


Source: NVD

Connexe JavaScript Vulnérabilités :

CVE ID

Gravité

Partition

Technologies

Nom du composant

Exploit CISA KEV

A corrigé

Date de publication

GHSA-j7r2-xppq-m353HIGH7.5
  • JavaScript logoJavaScript
  • websocket-driver
NonOuiNov 28, 2026
GHSA-w7cm-vp9h-3qp4MEDIUM6.3
  • JavaScript logoJavaScript
  • axios
NonOuiNov 28, 2026
GHSA-mw39-9473-h7mrMEDIUM6.3
  • JavaScript logoJavaScript
  • axios
NonOuiNov 28, 2026
GHSA-v2qg-6486-r9rfLOW2.3
  • JavaScript logoJavaScript
  • axios
NonOuiNov 28, 2026
GHSA-jm66-q5wm-qf72MEDIUMN/A
  • JavaScript logoJavaScript
  • orbitdb-relay
NonNonNov 28, 2026

Évaluation gratuite des vulnérabilités

Évaluez votre posture de sécurité cloud

Évaluez vos pratiques de sécurité cloud dans 9 domaines de sécurité afin d’évaluer votre niveau de risque et d’identifier les lacunes dans vos défenses.

Évaluation de la demande

Ressources Wiz supplémentaires

Obtenez une démo personnalisée

Prêt(e) à voir Wiz en action ?

"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
David EstlickRSSI
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
Adam FletcherChef du service de sécurité
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."
Greg PoniatowskiResponsable de la gestion des menaces et des vulnérabilités