CVE-2023-45857

Cross-site Request Forgery
Affects
axios
in
Axios
No items found.
Versions
<1.6.0; <0.28.0

Patch Available.

Exclamation circle icon
Patch Available

This Vulnerability has been fixed in the Never-Ending Support (NES) version offered by HeroDevs.

Overview

Axios is a promise-based HTTP client for JavaScript applications running in the browser and Node.js. It provides a simple API, flexible request and response interceptors, and built-in support for automatic JSON transformation, request cancellation, and timeouts to simplify communication with APIs and services.

A vulnerability (CVE-2023-45857) has been identified in Axios’s handling of XSRF tokens in browser requests. Axios reads an XSRF token from a cookie and includes it in a request header to support CSRF protection. However, when withCredentials: true is configured, affected versions can attach this token to cross-origin requests. Using the default names, the XSRF-TOKEN cookie value is copied into the X-XSRF-TOKEN header, potentially exposing it to an attacker-controlled destination.

This exposure of an anti-CSRF token is classified under CWE-352 (Cross-Site Request Forgery) in the security advisory. CSRF occurs when an application cannot sufficiently verify that an authenticated request reflects the user’s intent. In Axios, disclosing the token to an untrusted host can undermine a token-based defense and potentially facilitate forged requests. Successful exploitation still depends on the application’s authentication requirements and other CSRF protections.

Details

Module Info

Vulnerability Info

This medium-severity vulnerability affects browser applications using vulnerable Axios versions with withCredentials: true and an accessible XSRF token cookie. The affected request logic allows credentialed cross-origin requests to carry the token, even when the destination is outside the application’s origin. The GitHub advisory assigns a CVSS v3.1 score of 6.5.

If an attacker can cause the application to send a qualifying request to an attacker-controlled host, that host may receive the token in the request header. The immediate impact is disclosure of sensitive token information. Whether the token can subsequently enable unauthorized actions depends on the application’s remaining defenses.

This behavior aligns with CWE-352 (Cross-Site Request Forgery), as classified by the advisory. Token secrecy supports CSRF prevention; exposing a valid token can weaken that protection. However, possession of the token alone does not establish an authenticated session or guarantee a successful XSRF attack.

Mitigation

Users of affected Axios packages should apply one of the following mitigations:

  • Upgrade to a patched version of the axios package.
  • Leverage commercial support — HeroDevs provides security support for Axios.
Vulnerability Details
Severity
Level
CVSS Assessment
Low
>=0 <4
Medium
>=4 <6
High
>=6 <8
Critical
>=8 <10
Medium
ID
CVE-2023-45857
PROJECT Affected
axios
Versions Affected
<1.6.0; <0.28.0
NES Versions Affected
Published date
September 23, 2026
≈ Fix date
September 9, 2026
Category
Cross-site Request Forgery
Vex Document
Download VEXHow do I use it?
Sign up for the latest vulnerability alerts fixed in
NES for Axios
Rss feed icon
Subscribe via RSS
or

By submitting the form I acknowledge receipt of our Privacy Policy.

Thanks for signing up for our Newsletter! We look forward to connecting with you.
Oops! Something went wrong while submitting the form.