CVE-2026-101903: Axios Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-c29m-xwm3-cm6r
CWE-1333
Published
Advisory Summary

CVE-2026-101903 is a HIGH denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Axios libraries in the npm ecosystem. The issue involves redos in fromdatauri data: url parser freezes the node event loop (dos). Remediation is available by upgrading affected packages to version 1.20.0.

CVE-2026-101903 at a Glance

CVE Identifier CVE-2026-101903
GHSA Identifier GHSA-c29m-xwm3-cm6r
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Axios
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-101903

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.

axios fixed: 1.20.0
npm install axios@1.20.0
Verify Direct and Transitive Dependencies

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-2026-101903, 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.20.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-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. 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

## Summary Axios for Node.js parses `data:` URLs in `lib/helpers/fromDataURI.js`. The current RFC-2397 parser uses a regular expression whose media type groups allow `/` inside both sides of the `type/subtype` match. A malformed `data:` URL containing many slashes and no comma forces the JavaScript regex engine to try many possible placements for the separator before failing. Applications are affected when they pass untrusted URL strings to axios and do not reject or constrain `data:` URLs before axios parses them. ## Impact An attacker can make the Node.js event loop spend significant synchronous CPU time parsing a single malformed URL. In a server that accepts a URL from an HTTP request and calls `axios.get(url)`, this can block unrelated requests and health checks until parsing completes. The issue is availability-only. It does not disclose data or modify requests. ## Affected Functionality Affected: - Node.js HTTP adapter data URL handling. - `axios.get()` or equivalent calls where `config.url` has the `data:` protocol. Not affected: - Browser fetch/XHR URL handling. - Node requests where the application rejects `data:` URLs before calling axios. - Older checked `0.x` data URL parser shape unless separately proven vulnerable. ## Technical Details `lib/helpers/fromDataURI.js` contains: ```js const DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; ``` The `[^,;]+` groups include `/`, so a long string of slashes without a comma can be partitioned around the required `\/` in many ways before the match fails. The match runs before axios can apply request timeout behavior, so `timeout` does not mitigate the parsing pause. Local timing on axios `1.18.1` with small payloads showed about 2.4 ms at 1000 slashes, 16.6 ms at 3000 slashes, and 71.5 ms at 6000 slashes, consistent with the submitted quadratic scaling while avoiding long-running payloads. ## Proof of Concept of Attack Constrained helper-level demonstration: ```js import axios from 'axios'; await axios.get('data:' + '/'.repeat(6000)); ``` The request fails after parsing, but the failure is delayed by synchronous regex work. Larger payloads increase the pause substantially. ## Workarounds Reject `data:` URLs before passing untrusted input to axios, or enforce a strict maximum URL length for URL-fetching endpoints. Applications that do not need `data:` URL support should deny that protocol explicitly. <details> <summary><h3>Original report</h3></summary> # ReDoS in `fromDataURI` data: URL parser freezes the event loop (DoS) ## Affected - Package: `axios` (Node.js http adapter) - Versions: 1.x (regex present on `v1.x`, current release line) - File: `lib/helpers/fromDataURI.js` - CWE-1333 (Inefficient Regular Expression Complexity) ## Issue `fromDataURI` parses `data:` URLs with this regex: ```js // lib/helpers/fromDataURI.js:9 const DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; ``` The mediatype tokens `[^,;]+` include `/`, so they can span multiple slashes ambiguously. A `data:` URL made of many slashes with no comma forces the engine to try every way to place the single `\/` divider before failing — quadratic O(n²) backtracking. It runs synchronously on the main thread, so the whole Node event loop is frozen for the entire parse. Reachable through the public API on the Node http adapter (`axios.get(url)`); the browser fetch/xhr adapters are not affected because they do not call `fromDataURI`. A configured `timeout` does not help: the freeze happens during parsing, before any network timer can fire. ## PoC (minimal) ```js import axios from 'axios'; // ~256 KB data: URL of pure slashes, no comma await axios.get('data:' + '/'.repeat(262139)); // blocks the event loop ~6 min, then throws ``` ## Lab results Single-threaded "fetch a user-supplied URL" service (link-preview style) calling `axios.get` on a JSON body `{ "url": "..." }`, with `timeout: 1000` set. Scaling is clean O(n²) (constant k ≈ 5.6e-6 ms/byte², stable across sizes): | data: URL size | Event-loop freeze (one request) | | --- | --- | | 32 KB | 6.3 s (measured end-to-end; server logged `event loop BLOCKED for 6.30s`) | | 64 KB | ~24 s | | 128 KB | ~96 s | | 256 KB | ~385 s (~6.4 min) | | 1 MB | ~100 min | During the freeze the server answers nothing: a `/healthz` liveness probe times out for the whole window, and the server's own event-loop monitor cannot even log until the parse finishes. In a run through an intercepting proxy, the proxy hit its 120 s upstream timeout and gave up, while the origin stayed pegged at 100% CPU on one core past that — client/proxy timeouts do not mitigate it. The attacker controls only the URL string and needs no auth. ~256 KB every ~6 min (≈ 0.7 bytes/sec) keeps a server permanently unavailable. ## Impact Unauthenticated remote denial of service. One small request takes a Node service fully offline for minutes; a trickle keeps it down indefinitely. CVSS 3.1: 7.5 (High) — `AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`. ## Fix RFC 2045 type/subtype tokens never contain `/`. Excluding `/` from those two character classes removes the ambiguity and the backtracking: ```js const DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/; ``` Worst-case parse drops from ~2600 ms to ~0.002 ms. All valid `data:` URLs, including slashes in the body, parse identically. </details> ---

CVE-2026-101903 Affected Axios Versions

1 component(s)
Fixed Versions:
1.20.0
Product / Package Ecosystem Affected Versions Fixed Version
axios
npm
≥ 1.16.1
< 1.20.0
1.20.0

References

Frequently Asked Questions

What is CVE-2026-101903?
CVE-2026-101903 is a security vulnerability in Axios involving ReDoS in fromDataURI data: URL parser freezes the Node event loop (DoS) under CWE-1333: Inefficient Regular Expression Complexity.
Which Axios versions are affected?
Affected versions include releases prior to 1.20.0 across affected packages: axios.
What version fixes CVE-2026-101903?
Upgrading to 1.20.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is axios affected?
Yes, axios is affected in releases prior to 1.20.0. Upgrade your dependency to 1.20.0 or later.
What CWE is associated with CVE-2026-101903?
CVE-2026-101903 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check npm dependencies for CVE-2026-101903?
Run the dependency tree command: 'npm ls axios'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c29m-xwm3-cm6r",
  "modified" : "2026-09-30T15:03:22Z",
  "published" : "2026-09-30T15:03:21Z",
  "aliases" : [ "CVE-2026-101903" ],
  "summary" : "Axios: ReDoS in fromDataURI data: URL parser freezes the Node event loop (DoS)",
  "details" : "## Summary\n\nAxios for Node.js parses `data:` URLs in `lib/helpers/fromDataURI.js`. The current RFC-2397 parser uses a regular expression whose media type groups allow `/` inside both sides of the `type/subtype` match. A malformed `data:` URL containing many slashes and no comma forces the JavaScript regex engine to try many possible placements for the separator before failing.\n\nApplications are affected when they pass untrusted URL strings to axios and do not reject or constrain `data:` URLs before axios parses them.\n\n## Impact\n\nAn attacker can make the Node.js event loop spend significant synchronous CPU time parsing a single malformed URL. In a server that accepts a URL from an HTTP request and calls `axios.get(url)`, this can block unrelated requests and health checks until parsing completes.\n\nThe issue is availability-only. It does not disclose data or modify requests.\n\n## Affected Functionality\n\nAffected:\n\n- Node.js HTTP adapter data URL handling.\n- `axios.get()` or equivalent calls where `config.url` has the `data:` protocol.\n\nNot affected:\n\n- Browser fetch/XHR URL handling.\n- Node requests where the application rejects `data:` URLs before calling axios.\n- Older checked `0.x` data URL parser shape unless separately proven vulnerable.\n\n## Technical Details\n\n`lib/helpers/fromDataURI.js` contains:\n\n```js\nconst DATA_URL_PATTERN = /^([^,;]+\\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\\s\\S]*)$/;\n```\n\nThe `[^,;]+` groups include `/`, so a long string of slashes without a comma can be partitioned around the required `\\/` in many ways before the match fails. The match runs before axios can apply request timeout behavior, so `timeout` does not mitigate the parsing pause.\n\nLocal timing on axios `1.18.1` with small payloads showed about 2.4 ms at 1000 slashes, 16.6 ms at 3000 slashes, and 71.5 ms at 6000 slashes, consistent with the submitted quadratic scaling while avoiding long-running payloads.\n\n## Proof of Concept of Attack\n\nConstrained helper-level demonstration:\n\n```js\nimport axios from 'axios';\n\nawait axios.get('data:' + '/'.repeat(6000));\n```\n\nThe request fails after parsing, but the failure is delayed by synchronous regex work. Larger payloads increase the pause substantially.\n\n## Workarounds\n\nReject `data:` URLs before passing untrusted input to axios, or enforce a strict maximum URL length for URL-fetching endpoints. Applications that do not need `data:` URL support should deny that protocol explicitly.\n\n<details>\n  <summary><h3>Original report</h3></summary>\n  \n# ReDoS in `fromDataURI` data: URL parser freezes the event loop (DoS)\n\n## Affected\n- Package: `axios` (Node.js http adapter)\n- Versions: 1.x (regex present on `v1.x`, current release line)\n- File: `lib/helpers/fromDataURI.js`\n- CWE-1333 (Inefficient Regular Expression Complexity)\n\n## Issue\n`fromDataURI` parses `data:` URLs with this regex:\n\n```js\n// lib/helpers/fromDataURI.js:9\nconst DATA_URL_PATTERN = /^([^,;]+\\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\\s\\S]*)$/;\n```\n\nThe mediatype tokens `[^,;]+` include `/`, so they can span multiple slashes ambiguously. A `data:` URL made of many slashes with no comma forces the engine to try every way to place the single `\\/` divider before failing — quadratic O(n²) backtracking. It runs synchronously on the main thread, so the whole Node event loop is frozen for the entire parse. Reachable through the public API on the Node http adapter (`axios.get(url)`); the browser fetch/xhr adapters are not affected because they do not call `fromDataURI`.\n\nA configured `timeout` does not help: the freeze happens during parsing, before any network timer can fire.\n\n## PoC (minimal)\n```js\nimport axios from 'axios';\n// ~256 KB data: URL of pure slashes, no comma\nawait axios.get('data:' + '/'.repeat(262139)); // blocks the event loop ~6 min, then throws\n```\n\n## Lab results\nSingle-threaded \"fetch a user-supplied URL\" service (link-preview style) calling `axios.get` on a JSON body `{ \"url\": \"...\" }`, with `timeout: 1000` set.\n\nScaling is clean O(n²) (constant k ≈ 5.6e-6 ms/byte², stable across sizes):\n\n| data: URL size | Event-loop freeze (one request) |\n| --- | --- |\n| 32 KB | 6.3 s (measured end-to-end; server logged `event loop BLOCKED for 6.30s`) |\n| 64 KB | ~24 s |\n| 128 KB | ~96 s |\n| 256 KB | ~385 s (~6.4 min) |\n| 1 MB | ~100 min |\n\nDuring the freeze the server answers nothing: a `/healthz` liveness probe times out for the whole window, and the server's own event-loop monitor cannot even log until the parse finishes. In a run through an intercepting proxy, the proxy hit its 120 s upstream timeout and gave up, while the origin stayed pegged at 100% CPU on one core past that — client/proxy timeouts do not mitigate it.\n\nThe attacker controls only the URL string and needs no auth. ~256 KB every ~6 min (≈ 0.7 bytes/sec) keeps a server permanently unavailable.\n\n## Impact\nUnauthenticated remote denial of service. One small request takes a Node service fully offline for minutes; a trickle keeps it down indefinitely.\nCVSS 3.1: 7.5 (High) — `AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`.\n\n## Fix\nRFC 2045 type/subtype tokens never contain `/`. Excluding `/` from those two character classes removes the ambiguity and the backtracking:\n\n```js\nconst DATA_URL_PATTERN = /^([^,;/]+\\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\\s\\S]*)$/;\n```\n\nWorst-case parse drops from ~2600 ms to ~0.002 ms. All valid `data:` URLs, including slashes in the body, parse identically.\n</details>\n\n---",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "axios"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.16.1"
      }, {
        "fixed" : "1.20.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/axios/axios/security/advisories/GHSA-c29m-xwm3-cm6r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-101903"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/axios/axios/pull/11141"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/axios/axios/commit/d19040bda7a8be2f82c3c6e1a5bc03917daee39a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/axios/axios"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/axios/axios/releases/tag/v1.20.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-30T15:03:21Z",
    "nvd_published_at" : "2026-09-28T18:17:18Z"
  }
}