# CVE-2026-42042: Axios: XSRF Token Cross-Origin Leakage via Prototype Pollution Gadget in `withXSRFToken` Boolean Coercion

> Prototype pollution allows attackers to bypass same-origin checks, leaking XSRF tokens to cross-origin servers in Axios HTTP clients.

- **Severity:** Medium 5.4 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/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:** 24 Apr 2026
- **Updated:** 27 Apr 2026
- **Also known as:** CLEANSTART-2026-BR76038, CLEANSTART-2026-LN42574, DEBIAN-CVE-2026-42042, ECHO-f974-2d2f-b5cf, GHSA-xx6v-rp6x-q39c, MINI-29w3-69vm-c24f, MINI-5m5p-r9wp-pmh8, MINI-8fx2-gv38-9cp4, MINI-8rjp-v72h-mr99, MINI-977g-chxj-qmwg, MINI-98jr-mqph-526v, MINI-c62g-77j2-q386, MINI-cmv7-vpxj-gjx3, MINI-cv8v-q8mr-5h94, MINI-fg42-9pfc-fh55, MINI-gfjf-6q7w-rmxm, MINI-h367-f6wp-qjxx, MINI-hvh2-96rx-fhpr, MINI-jqc7-6c7p-2hx8, MINI-qmq9-4g83-wfq6, MINI-qprj-439g-mq9v, MINI-w4wx-fx8m-c5wv, MINI-w938-cp23-3hr5, MINI-xxfj-4586-wv9j, ROOT-APP-NPM-CVE-2026-42042, UBUNTU-CVE-2026-42042

## What is CVE-2026-42042?

CVE-2026-42042 is a medium-severity vulnerability in axios, published on 24 Apr 2026. 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

Axios is a promise based HTTP client for the browser and Node.js. Prior to 1.15.1 and 0.31.1, the Axios library's XSRF token protection logic uses JavaScript truthy/falsy semantics instead of strict boolean comparison for the withXSRFToken config property. When this property is set to any truthy non-boolean value (via prototype pollution or misconfiguration), the same-origin check (isURLSameOrigin) is short-circuited, causing XSRF tokens to be sent to all request targets including cross-origin servers controlled by an attacker. This vulnerability is fixed in 1.15.1 and 0.31.1.

Weakness: CWE-201 (Insertion of Sensitive Information Into Sent Data), CWE-183 (Permissive List of Allowed Inputs)

## Which versions are affected by CVE-2026-42042?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `axios` | npm | All versions | 0.31.1 |
| `axios` | npm | All versions | 0.31.1 |
| `axios` | npm | From 1.0.0 | 1.15.1 |
| `axios` | npm | From 1.0.0 | 1.15.1 |

Products: Axios Axios.

## How do I fix CVE-2026-42042?

Upgrade axios to a fixed version for your release line: 0.31.1 or 1.15.1.

## Is CVE-2026-42042 being exploited?

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

## Other vulnerabilities in axios

- [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-2026-42042 and fix it if it is affected.

What it is: CVE-2026-42042 is a medium-severity vulnerability in axios, published on 24 Apr 2026. 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-2026-42042 exists.

Affected packages and fixed versions:
- axios (npm): affected all versions; fixed in 0.31.1
- axios (npm): affected all versions; fixed in 0.31.1
- axios (npm): affected from 1.0.0; fixed in 1.15.1
- axios (npm): affected from 1.0.0; fixed in 1.15.1

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-2026-42042/ (Markdown: https://insights.sbomify.com/CVE-2026-42042/index.md)
```

## Sources

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

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