CVE-2023-45857: Axios Axios Cross-Site Request Forgery Vulnerability Vulnerability
MODERATECVE-2023-45857 is a MODERATE (CVSS 6.5) axios cross-site request forgery vulnerability vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Axios libraries in the npm ecosystem. The issue involves axios cross-site request forgery vulnerability. Remediation is available by upgrading affected packages to version 1.6.0, 0.28.0.
CVE-2023-45857 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N).
How to Fix CVE-2023-45857
To remediate this vulnerability, upgrade all affected Axios dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install axios@1.6.0
npm install axios@0.28.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls axios
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-45857, inspect your project dependencies using npm:
npm ls axios
Analyze the terminal output to locate any version of Axios in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.0), your application is affected.
Note: The npm ls axios command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. In Axios, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-45857 Affected Axios Versions
2 component(s)References
Frequently Asked Questions
What is CVE-2023-45857?
Which Axios versions are affected?
What version fixes CVE-2023-45857?
Is axios affected?
What is the CVSS score of CVE-2023-45857?
What CWE is associated with CVE-2023-45857?
How can I check npm dependencies for CVE-2023-45857?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wf5p-g6vw-rhxx",
"modified" : "2024-06-21T21:33:58Z",
"published" : "2023-11-08T21:30:37Z",
"aliases" : [ "CVE-2023-45857" ],
"summary" : "Axios Cross-Site Request Forgery Vulnerability",
"details" : "An issue discovered in Axios 0.8.1 through 1.5.1 inadvertently reveals the confidential XSRF-TOKEN stored in cookies by including it in the HTTP header X-XSRF-TOKEN for every request made to any host allowing attackers to view sensitive information.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "axios"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.6.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "axios"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.8.1"
}, {
"fixed" : "0.28.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-45857"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/issues/6006"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/issues/6022"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/pull/6028"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/pull/6091"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/commit/2755df562b9c194fba6d8b609a383443f6a6e967"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/commit/96ee232bd3ee4de2e657333d4d2191cd389e14d0"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/axios/axios"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/releases/tag/v0.28.0"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/releases/tag/v1.6.0"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20240621-0006"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-JS-AXIOS-6032459"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-352" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-11-10T00:35:37Z",
"nvd_published_at" : "2023-11-08T21:15:08Z"
}
}