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

> Axios leaks XSRF tokens to all hosts, allowing attackers to view sensitive information and potentially bypass CSRF protections.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 8 Nov 2023
- **Updated:** 4 Sep 2024
- **Also known as:** CLSA-2026-1784943156, DEBIAN-CVE-2023-45857, GHSA-wf5p-g6vw-rhxx, ROOT-APP-NPM-CVE-2023-45857, UBUNTU-CVE-2023-45857

## What is CVE-2023-45857?

CVE-2023-45857 is a medium-severity vulnerability in n/a, published on 8 Nov 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

An issue discovered in Axios 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.

Weakness: CWE-352 (Cross-Site Request Forgery)

## Which versions are affected by CVE-2023-45857?

4 open source packages ship an affected version, including axios. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `axios` | npm | From 0.8.1 | 0.28.0 |
| `axios` | npm | From 0.8.1 | 0.28.0 |
| `axios` | npm | From 1.0.0 | 1.6.0 |
| `axios` | npm | From 1.0.0 | 1.6.0 |

Products: Axios Axios.

## How do I fix CVE-2023-45857?

Upgrade axios to a fixed version for your release line: 0.28.0 or 1.6.0.

## Is CVE-2023-45857 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-45857 exists.

Public exploit code:

- https://github.com/fuyuooumi1027/CVE-2023-45857-Demo (github_poc): https://github.com/fuyuooumi1027/CVE-2023-45857-Demo
- https://github.com/valentin-panov/CVE-2023-45857 (github_poc): https://github.com/valentin-panov/CVE-2023-45857
- CVE-2023-45857の挙動を確認するデモ (github_poc): https://github.com/intercept6/CVE-2023-45857-Demo

## Other vulnerabilities in n/a

- [CVE-2026-44494](https://insights.sbomify.com/CVE-2026-44494/): Axios: Full Man-in-the-Middle via Prototype Pollution Gadget in `config.proxy` (high 8.7)
- [CVE-2026-44492](https://insights.sbomify.com/CVE-2026-44492/): axios's shouldBypassProxy does not recognize IPv4-mapped IPv6 addresses, allowing NO_PROXY bypass (incomplete fix for CVE-2025-62718) (high 8.6)
- [CVE-2026-67320](https://insights.sbomify.com/CVE-2026-67320/): axios before 0.33.0 Prototype Pollution via Node HTTP adapter (high 8.3)
- [CVE-2026-44487](https://insights.sbomify.com/CVE-2026-44487/): Axios: Proxy-Authorization Credential Leak to Origin Server Across HTTP-to-HTTPS Redirect in Axios Node.js HTTP Adapter (high 8.2)
- [CVE-2025-27152](https://insights.sbomify.com/CVE-2025-27152/): Possible SSRF and Credential Leakage via Absolute URL in axios Requests (high 7.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-45857 and fix it if it is affected.

What it is: CVE-2023-45857 is a medium-severity vulnerability in n/a, published on 8 Nov 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-45857 exists.

Affected packages and fixed versions:
- axios (npm): affected from 0.8.1; fixed in 0.28.0
- axios (npm): affected from 0.8.1; fixed in 0.28.0
- axios (npm): affected from 1.0.0; fixed in 1.6.0
- axios (npm): affected from 1.0.0; fixed in 1.6.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-45857/ (Markdown: https://insights.sbomify.com/CVE-2023-45857/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-45857
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-45857
- OSV: https://osv.dev/vulnerability/CVE-2023-45857

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-45857/
Summaries are generated and may contain mistakes; the official description above is the record.
