Axios HTTP Library Security Flaw Exposes XSRF Tokens, Prompting Urgent Update to v0.30.0
A critical security vulnerability in the widely-used Axios HTTP client library is forcing developers to scramble for updates. The flaw, tracked as CVE-2023-45857, inadvertently leaks the confidential XSRF-TOKEN stored in cookies by automatically including it in the HTTP header for every request made to any host. This exposure allows potential attackers to view sensitive information, compromising the security of countless web applications that rely on Axios for API communication.
The vulnerability affects a broad range of Axios versions, from 0.8.1 through 1.5.1. The issue stems from the library's default behavior of automatically attaching the X-XSRF-TOKEN header based on cookie values, without proper host validation. This means any site or malicious actor that can make a request through a vulnerable application could potentially intercept these tokens. The severity is rated as Medium with a CVSS score of 6.5, characterized by its network-based attack vector, low attack complexity, and no required privileges or user interaction.
The primary mitigation is an immediate update to Axios version 0.30.0 or later, where the flaw has been addressed. Dependency management bots like Renovate are already flagging this as a security priority. For organizations with extensive codebases, this vulnerability necessitates a comprehensive audit of all projects using Axios to ensure patches are applied, as the library is a foundational component in both frontend and backend Node.js ecosystems. The silent nature of this data leak means the exposure could have been ongoing without detection, elevating the urgency of the update.