6.9medium
Axios: unbounded recursion in toFormData causes DoS via deeply nested request data
- Severity
- 6.9medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.80% (higher than 57% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-62hf-57xw-28j9
Description
Axios is a promise based HTTP client for the browser and Node.js. Prior to 1.15.1 and 0.31.1, toFormData recursively walks nested objects with no depth limit, so a deeply nested value passed as request data crashes the Node.js process with a RangeError. This vulnerability is fixed in 1.15.1 and 0.31.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| axios axios | >= 1.0.0, < 1.15.1, < 0.31.1, before 0.31.1, from 1.0.0 before 1.15.1 | CVE List, NVD |
| axios | Not specified | CVE List |
| multicluster-engine/console-mce-rhel9 | Not specified Not affected: from 1780917531 before *, from 1780910888 before *, from 1778511348 before *, from 1778383863 before *, from 1778532610 before * | CVE List |
| network-observability/network-observability-console-plugin-rhel9 | Not specified Not affected: from 1778510461 before * | CVE List |
| network-observability/network-observability-console-plugin-pf4-rhel9 | Not specified Not affected: from 1780920979 before * | CVE List |
| rhacm2/console-rhel9 | Not specified Not affected: from 1783451729 before *, from 1780876734 before *, from 1780600823 before * | CVE List |
| advanced-cluster-security/rhacs-main-rhel8 | Not specified Not affected: from 1779371594 before *, from 1779293013 before * | CVE List |
| rhdh/rhdh-hub-rhel9 | Not specified Not affected: from 1779841586 before *, from 1782761244 before * | CVE List |
| discovery/discovery-ui-rhel9 | Not specified Not affected: from 1778156756 before * | CVE List |
| rhmtc/openshift-migration-ui-rhel8 | Not specified Not affected: from 1780590717 before * | CVE List |
| mta/mta-ui-rhel9 | Not specified Not affected: from 1785169013 before * | CVE List |
| rhoai/odh-dashboard-rhel9 | Not specified Not affected: from 1780467029 before * | CVE List |
| rhoai/odh-mod-arch-model-registry-rhel9 | Not specified Not affected: from 1780467147 before * | CVE List |
| openshift4/ose-agent-installer-ui-rhel9 | Not specified Not affected: from 1778645099 before *, from 1778539338 before * | CVE List |
| openshift4/ose-monitoring-plugin-rhel9 | Not specified Not affected: from 1785354128 before * | CVE List |
| devspaces/code-rhel9 | Not specified Not affected: from 1779814592 before * | CVE List |
| devspaces/dashboard-rhel9 | Not specified Not affected: from 1779341289 before * | CVE List |
| openshift-service-mesh/kiali-ossmc-rhel8 | Not specified Not affected: from 1778191473 before * | CVE List |
| openshift-service-mesh/kiali-rhel8 | Not specified Not affected: from 1778191378 before * | CVE List |
| openshift-service-mesh/kiali-ossmc-rhel9 | Not specified Not affected: from 1778163785 before *, from 1778163935 before *, from 1778163792 before * | CVE List |
| openshift-service-mesh/kiali-rhel9 | Not specified Not affected: from 1778164208 before *, from 1778164042 before *, from 1778163909 before *, from 1778163986 before * | CVE List |
| quay/quay-rhel8 | Not specified Not affected: from 1779822261 before *, from 1779811412 before *, from 1779689392 before *, from 1780891395 before *, from 1779811473 before * | CVE List |
| quay/quay-rhel9 | Not specified Not affected: from 1779204086 before *, from 1779922205 before *, from 1784987273 before * | CVE List |
| satellite/iop-advisor-frontend-rhel9 | Not specified Not affected: from 1781181673 before * | CVE List |
| satellite/iop-vulnerability-frontend-rhel9 | Not specified Not affected: from 1781032495 before * | CVE List |
| gatekeeper/gatekeeper-rhel9 | Not specified | CVE List |
| mta/mta-ui-rhel8 | Not specified | CVE List |
| network-observability/network-observability-console-plugin-compat-rhel9 | Not specified | CVE List |
| openshift-pipelines/pipelines-hub-ui-rhel8 | Not specified | CVE List |
| openshift-pipelines/pipelines-hub-ui-rhel9 | Not specified | CVE List |
| openshift-service-mesh/kiali-operator-bundle | Not specified | CVE List |
| openshift-service-mesh/kiali-rhel9-operator | Not specified | CVE List |
| 3scale-amp21/system | Not specified | CVE List |
| 3scale-amp22/system | Not specified | CVE List |
| 3scale-amp2/system-rhel7 | Not specified | CVE List |
| 3scale-amp2/system-rhel8 | Not specified | CVE List |
| 3scale-amp2/system-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/gateway-rhel9 | Not specified | CVE List |
| ansible-automation-platform/automation-dashboard-rhel9 | Not specified | CVE List |
| automation-controller | Not specified | CVE List |
| automation-gateway | Not specified | CVE List |
| automation-hub | Not specified | CVE List |
| automation-platform-ui | Not specified | CVE List |
| python3.11-galaxy-ng | Not specified | CVE List |
| python3.12-galaxy-ng | Not specified | CVE List |
| python3x-galaxy-ng | Not specified | CVE List |
| python-galaxy-ng | Not specified | CVE List |
| apicurio/apicurio-registry-ui-rhel8 | Not specified | CVE List |
| apicurio/apicurio-registry-ui-rhel9 | Not specified | CVE List |
| rhdesktop/rh-podman-desktop-ext-openshift-local-rhel10 | Not specified | CVE List |
| grafana | Not specified | CVE List |
| rhelai3/bootc-cuda-rhel9 | Not specified | CVE List |
| rhelai3/bootc-rocm-rhel9 | Not specified | CVE List |
| rhelai3/disk-image-cuda-rhel9 | Not specified | CVE List |
| boost | Not specified | CVE List |
| rhoai/odh-dashboard-rhel8 | Not specified | CVE List |
| rhoai/odh-mod-arch-gen-ai-rhel9 | Not specified | CVE List |
| rhoai/odh-mod-arch-maas-rhel9 | Not specified | CVE List |
| openshift3/ose-console | Not specified | CVE List |
| openshift4/ose-console | Not specified | CVE List |
| openshift4/ose-console-rhel9 | Not specified | CVE List |
| container-native-virtualization/kubevirt-console-plugin | Not specified | CVE List |
| container-native-virtualization/kubevirt-console-plugin-rhel9 | Not specified | CVE List |
| satellite/iop-host-inventory-frontend-rhel9 | Not specified | CVE List |
| rhtas/rhtas-console-ui-rhel9 | Not specified | CVE List |
| rhtpa/rhtpa-trustification-service-rhel9 | Not specified | CVE List |
| ansible-automation-platform/automation-portal | Not specified | CVE List |
| axios (npm) | from 1.0.0 before 1.15.1, before 0.31.1 | GitHub Advisory Database |
All scores
| GitHub_M | 6.9medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N |
| redhat-SADP | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
What each source says
CVE List
Axios is a promise based HTTP client for the browser and Node.js. Prior to 1.15.1 and 0.31.1, toFormData recursively walks nested objects with no depth limit, so a deeply nested value passed as request data crashes the Node.js process with a RangeError. This vulnerability is fixed in 1.15.1 and 0.31.1.
GitHub Advisory Database
Summary
toFormData recursively walks nested objects with no depth limit, so a deeply nested value passed as request data crashes the Node.js process with a RangeError.
Details
lib/helpers/toFormData.js:210 defines an inner build(value, path) that recurses into every object/array child (line 225: build(el, path ? path.concat(key) : [key])). The only safeguard is a stack array used to detect circular references; there is no maximum depth and no try/catch around the recursion. Because build calls itself once per nesting level, a payload nested roughly 2000+ levels deep exhausts V8's call stack.
toFormData is the serializer behind FormData request bodies and AxiosURLSearchParams (used by buildURL when params is an object with URLSearchParams unavailable, see lib/helpers/buildURL.js:53 and lib/helpers/AxiosURLSearchParams.js:36). Any server-side code that forwards a client-supplied object into axios({ data, params }) therefore reaches the recursive walker with attacker-controlled depth.
The RangeError is thrown synchronously from inside forEach, escapes toFormData, and propagates out of the axios request call. In typical Express/Fastify request handlers this terminates the running request; in synchronous startup paths or worker threads it can crash the whole process.
PoC
import toFormData from 'axios/lib/helpers/toFormData.js';
import FormData from 'form-data';
function nest(depth) {
let o = { leaf: 1 };
for (let i = 0; i < depth; i++) o = { a: o };
return o;
}
try {
toFormData(nest(2500), new FormData());
} catch (e) {
console.log(e.name + ': ' + e.message);
}
// RangeError: Maximum call stack size exceeded
Server-side reachability example:
// vulnerable proxy pattern
app.post('/forward', async (req, res) => {
await axios.post('https://upstream/api', req.body); // req.body user-controlled
res.send('ok');
});
// attacker POST /forward with {"a":{"a":{"a":... 2500 deep ...}}}
// -> toFormData build() overflows -> request handler crashes
Verified on axios 1.15.0 (latest, 2026-04-10), Node.js 20, 3/3 PoC runs reproduce the RangeError at depth 2500.
Impact
A remote, unauthenticated attacker who can influence an object passed to axios as request data or params triggers an uncaught RangeError inside the synchronous recursive walker. In server-side applications that proxy or re-send client JSON through axios this crashes the request handler and, in worker/cluster setups, the process. Fix by bounding recursion depth in toFormData's build function (reject or throw on depths beyond a configurable limit, e.g. 100) or rewriting the walker iteratively.
NVD (es)
Axios es un cliente HTTP basado en promesas para el navegador y Node.js. Antes de 1.15.1 y 0.31.1, toFormData recorre recursivamente objetos anidados sin límite de profundidad, por lo que un valor profundamente anidado pasado como datos de solicitud bloquea el proceso de Node.js con un RangeError. Esta vulnerabilidad está corregida en 1.15.1 y 0.31.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-42039 changed 2026-09-10 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-62hf-57xw-28j9 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-42039 changed 2026-11-11 | Public domain |