Description

Axios maintainers have addressed four high-severity security vulnerabilities affecting the JavaScript-based HTTP client library. One of the flaws could expose sensitive authentication information, including bearer tokens and session cookies, when an authenticated request is redirected by a trusted server to a subdomain controlled by an attacker. The issue affects Axios applications using the Node.js HTTP adapter, where credentials supplied through Authorization or Cookie headers may be forwarded across origins. The vulnerability occurs because the underlying dependency incorrectly considers certain subdomains trustworthy. To exploit this weakness, an attacker must influence the redirect and control or monitor its destination under specific port and protocol conditions. The remaining three vulnerabilities could affect the availability and stability of applications running Axios. The first involves improper cleanup handling in the fetch adapter when requests are cancelled using an AbortSignal, potentially causing an unhandled exception that terminates the Node.js process. Exploitation also depends on a separate prototype pollution vulnerability. The second flaw affects the HTTP adapter's bandwidth-limiting functionality, where configuring a positive transfer rate below two bytes per second can cause repeated data queuing, eventually blocking the event loop and making the application unresponsive. The third vulnerability relates to unsafe data serialization, where Axios may trust an object's declared length without validating the actual elements, resulting in excessive memory allocation, application freezes, or Node.js heap exhaustion. Axios version 1.21.0 addresses all four vulnerabilities, while version 0.35.0 provides fixes for the redirect and serialization issues in the 0.x branch. Organizations should upgrade to the appropriate patched release as soon as possible. Until updates are implemented, security teams should disable automatic redirects for authenticated requests, validate redirect destinations before forwarding credentials, and maintain transfer rate limits of at least two bytes per second. Applications should also validate user-supplied data structures and enforce strict array length limits before passing them to Axios.