CVE-2023-45857: Axios Cross-Site Request Forgery Vulnerability

axios Updated 02 Oct 2025

Summary

08/11/2023
Yes i
Moderate
6.5

CVE-2023-45857: Axios Cross-Site Request Forgery Vulnerability. Affects axios across 2 version ranges.

>= 0.8.1, < 0.28.0 >= 1.0.0, < 1.6.0

Fixed in 0.28.0 or 1.6.0, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2023-45857 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Axios is an open-source JavaScript library used for making HTTP requests from browsers and Node.js. It provides an easy-to-use API for handling asynchronous HTTP requests and supports features like request cancellation, interceptors, and automatic JSON data transformation. However, versions 0.8.1 through 1.5.1 of Axios contain a vulnerability that inadvertently exposes the confidential XSRF-TOKEN stored in cookies. This vulnerability allows attackers to view sensitive information by including the XSRF-TOKEN in the HTTP header X-XSRF-TOKEN for every request made to any host.

Vulnerability Detail

The vulnerability in Axios arises from the inclusion of the XSRF-TOKEN in the X-XSRF-TOKEN header for all requests. This exposes the XSRF-TOKEN, which is meant to be confidential, to potential attackers. By viewing this token, attackers can gain access to sensitive information and potentially perform cross-site request forgery attacks. The vulnerability has a moderate severity rating and is assigned the Common Weakness Enumeration (CWE) ID 352.

How To Fix

Latest published version: 1.20.0 as of 22 Oct 2026

npm install axios@1.20.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 0.8.1, < 0.28.0 0.28.0
    npm install axios@0.28.0
  • >= 1.0.0, < 1.6.0 1.6.0
    npm install axios@1.6.0

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability. The recommended solution is to upgrade to the fixed version of Axios.

Conclusion

The Axios Cross-Site Request Forgery Vulnerability exposes the confidential XSRF-TOKEN stored in cookies, allowing attackers to view sensitive information. Upgrading to Axios version 1.6.0 or later is recommended to fix this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for axios →

Share this vulnerability

FAQ

Axios is an open-source JavaScript library used for making HTTP requests from browsers and Node.js. It provides an easy-to-use API for handling asynchronous HTTP requests.

The vulnerability allows attackers to view sensitive information by exposing the XSRF-TOKEN stored in cookies. This can lead to unauthorized access and potential cross-site request forgery attacks.

To fix this vulnerability, upgrade Axios to version 1.6.0 or later. This version removes the inclusion of the XSRF-TOKEN in the X-XSRF-TOKEN header for requests.

There is no specific workaround mentioned for this vulnerability. Upgrading to the fixed version is the recommended solution.

The vulnerability has a moderate severity rating.

Related vulnerabilities

Recent vulnerabilities recorded for axios.

How To Fix

Latest published version: 1.20.0 as of 22 Oct 2026

npm install axios@1.20.0

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • >= 0.8.1, < 0.28.0 0.28.0
    npm install axios@0.28.0
  • >= 1.0.0, < 1.6.0 1.6.0
    npm install axios@1.6.0

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback