Description

A severe security flaw has been discovered in Axios, a popular HTTP client for Node.js and browsers. It is tracked as CVE-2025-54371 (CVSS: 7.5), and the root cause is a vulnerability in a transitive dependency, which is the form-data@4.0.0 module consumed by axios@1.10.0. The vulnerability lies in the fact that it uses insecure, predictable randomness (Math.random()) for creating multipart boundaries within HTTP requests. This leaves the door open for attackers to tamper with multipart/form-data requests and take advantage of vulnerabilities like HTTP parameter pollution, request smuggling, or backend deserialization vulnerabilities. This vulnerability is especially critical because of Axios's staggering adoption rate—more than 292 million downloads each month—and its function of dealing with HTTP traffic in both browser-based and server-side JavaScript applications. Because multipart boundary values are designed to demarcate form-data fields in a secure manner, predictability can enable attackers to manipulate request structure and payload interpretation, even bypassing backend service or microservices architecture security controls. These vulnerabilities make the bug extremely important for APIs and services that depend on correct multipart parsing. To reduce the risk, developers are advised to update to Axios version 1.11.0 or higher, which employs a fixed version of form-data (>=4.0.4) that is based on cryptographically secure randomness. Organizations should scan their JavaScript dependencies and CI/CD workflows to guarantee that affected packages are not being used. Monitoring for out-of-pattern multipart requests and applying strict API gateway validation can also minimize exposure.