Back to Blog
high SEVERITY5 min read

How Denial of Service via Unbounded Data Size Happens in Node.js HTTP Clients and How to Fix It

A high-severity denial of service vulnerability (CVE-2025-58754) was discovered in axios versions prior to 1.12.0, where the library failed to enforce data size limits on HTTP responses. This flaw could allow attackers to crash Node.js applications by sending massive payloads that exhaust memory. The fix involved upgrading axios from version 1.11.0 to 1.12.0 in the ComfyUIGen plugin's dependencies.

O
By Orbis AppSec
Published August 9, 2026Reviewed August 9, 2026

Answer Summary

CVE-2025-58754 is a high-severity Denial of Service (DoS) vulnerability in axios, a popular Node.js HTTP client library, caused by missing data size validation on incoming responses (CWE-400: Uncontrolled Resource Consumption). Attackers can exploit this by sending extremely large HTTP responses that exhaust application memory. The fix is straightforward: upgrade axios to version 1.12.0 or later, which implements proper response size limits.

Vulnerability at a Glance

cweCWE-400
fixUpgrade axios dependency from 1.11.0 to 1.12.0
riskApplication crash and service unavailability through memory exhaustion
languageJavaScript/Node.js
root causeaxios versions before 1.12.0 did not validate or limit incoming HTTP response sizes
vulnerabilityDenial of Service (DoS) via Unbounded Data Size

Introduction

The ComfyUIGen plugin, designed for AI image generation via ComfyUI, relied on axios version 1.11.0 for making HTTP requests. During a routine security scan, Trivy flagged a critical issue: the axios dependency in Plugin/ComfyUIGen/package-lock.json was vulnerable to CVE-2025-58754, a denial of service attack that could bring down the entire application.

This vulnerability is particularly dangerous for plugins that interact with external services—exactly what ComfyUIGen does when communicating with ComfyUI backends. An attacker controlling or intercepting these HTTP responses could craft a malicious payload designed to exhaust the Node.js process's memory, causing the plugin and potentially the entire application to crash.

The Vulnerability Explained

What Went Wrong

Axios is one of the most popular HTTP client libraries in the JavaScript ecosystem, used by millions of projects for making HTTP requests. In versions prior to 1.12.0, axios had a fundamental flaw: it didn't properly enforce limits on the size of data it would accept from HTTP responses.

Looking at the vulnerable dependency declaration in package.json:

"dependencies": {
    "axios": "^1.6.0",
    "uuid": "^9.0.0"
}

This semver range (^1.6.0) allowed npm to resolve to version 1.11.0, which is what the package-lock.json recorded:

"node_modules/axios": {
    "version": "1.11.0",
    "resolved": "https://registry.npmmirror.com/axios/-/axios-1.11.0.tgz",
    "integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==",
    ...
}

How the Attack Works

Consider how ComfyUIGen likely uses axios to communicate with a ComfyUI backend:

const axios = require('axios');

// Fetching generated image data from ComfyUI
const response = await axios.get('http://comfyui-server/api/images/output.png');
const imageData = response.data;

In a normal scenario, this returns image data of a few megabytes. But what if an attacker can control or intercept the response? They could return an HTTP response claiming to be a valid image but actually streaming gigabytes of data:

HTTP/1.1 200 OK
Content-Type: image/png
Transfer-Encoding: chunked

[Endless stream of data...]

With vulnerable axios versions, the library would happily buffer this entire response into memory. A 4GB response on a server with 2GB of RAM? The Node.js process crashes with an out-of-memory error. The service becomes unavailable. If this is a production system handling multiple users, all of them lose access.

Real-World Attack Scenario

For ComfyUIGen specifically, the attack surface includes:

  1. Compromised ComfyUI Server: If an attacker gains control of the ComfyUI backend, they can return malicious responses to all axios requests
  2. Man-in-the-Middle: On networks without TLS or with certificate validation disabled, attackers can intercept and modify responses
  3. DNS Hijacking: Redirecting the ComfyUI hostname to an attacker-controlled server

Any of these scenarios allows the attacker to send unbounded data that crashes the plugin.

The Fix

The fix is elegantly simple: upgrade axios to version 1.12.0, which properly enforces data size limits.

Before (Vulnerable)

package.json:

"dependencies": {
    "axios": "^1.6.0",
    "uuid": "^9.0.0"
}

package-lock.json:

"node_modules/axios": {
    "version": "1.11.0",
    "resolved": "https://registry.npmmirror.com/axios/-/axios-1.11.0.tgz",
    ...
}

After (Fixed)

package.json:

"dependencies": {
    "axios": "^1.12.0",
    "uuid": "^9.0.0"
}

package-lock.json:

"node_modules/axios": {
    "version": "1.12.0",
    "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.0.tgz",
    "integrity": "sha512-oXTDccv8PcfjZmPGlWsPSwtOJCZ/b6W5jAMCNcfwJbCzDckwG0jrYJFaWH1yvivfCXjVzV/SPDEhMB3Q+DSurg==",
    ...
}

Why Both Files Changed

  1. package.json: The version constraint was updated from ^1.6.0 to ^1.12.0 to ensure that future npm install commands will always resolve to at least version 1.12.0

  2. package-lock.json: This file records the exact resolved version. Updating it ensures that all developers and CI/CD pipelines get the exact same patched version (1.12.0) rather than potentially resolving to a vulnerable version

What axios 1.12.0 Does Differently

The patched version implements proper enforcement of the maxContentLength and maxBodyLength configuration options. Even if developers don't explicitly set these limits, axios 1.12.0 applies sensible defaults that prevent unbounded memory consumption.

Prevention & Best Practices

1. Pin Dependencies Appropriately

While semver ranges like ^1.6.0 are convenient, they can allow vulnerable versions to be installed. Consider:

// More restrictive: only patch updates
"axios": "~1.12.0"

// Most restrictive: exact version
"axios": "1.12.0"

2. Implement Defense in Depth

Even with patched libraries, add your own safeguards:

const axios = require('axios');

const client = axios.create({
    maxContentLength: 50 * 1024 * 1024, // 50MB max
    maxBodyLength: 50 * 1024 * 1024,
    timeout: 30000, // 30 second timeout
});

3. Regular Dependency Auditing

Run security audits as part of your CI/CD pipeline:

npm audit
npx trivy fs --scanners vuln .

4. Use Lockfile Maintenance

Regularly update your lockfile to get security patches:

npm update
npm audit fix

5. Monitor for CVEs

Subscribe to security advisories for your critical dependencies. The Node.js security ecosystem has tools like npm audit built in, but third-party scanners like Trivy, Snyk, and Dependabot provide additional coverage.

Key Takeaways

  • Axios versions before 1.12.0 are vulnerable to CVE-2025-58754: Any project using axios 1.11.0 or earlier should upgrade immediately
  • The ComfyUIGen plugin's HTTP communication with ComfyUI backends was at risk: External service communication is a prime attack vector for DoS vulnerabilities
  • Semver ranges can silently allow vulnerable versions: The ^1.6.0 constraint permitted resolution to the vulnerable 1.11.0 version
  • Both package.json and package-lock.json must be updated: Changing only one file leaves the vulnerability potentially exploitable
  • Defense in depth matters: Even with patched libraries, explicitly setting maxContentLength and timeout provides additional protection

How Orbis AppSec Detected This

  • Source: HTTP responses from external ComfyUI services consumed by the axios client in the ComfyUIGen plugin
  • Sink: axios response handling in Plugin/ComfyUIGen/ where unbounded data could be buffered into memory
  • Missing control: No enforced limit on HTTP response body size in axios versions prior to 1.12.0
  • CWE: CWE-400 (Uncontrolled Resource Consumption)
  • Fix: Upgraded axios dependency from 1.11.0 to 1.12.0 in both package.json and package-lock.json

Orbis AppSec automatically detected this vulnerability and opened a pull request with the fix. Try Orbis AppSec on your repositories to find and fix issues like this automatically.

Conclusion

CVE-2025-58754 serves as a reminder that even well-maintained, popular libraries can have serious security flaws. The axios library is used by countless Node.js applications, and this DoS vulnerability could have widespread impact if left unpatched.

For the ComfyUIGen plugin specifically, this vulnerability could have allowed attackers to crash the image generation service by exploiting the HTTP communication channel with ComfyUI backends. The fix—a simple version bump—eliminates this attack vector while maintaining full backward compatibility.

Keep your dependencies updated, run regular security audits, and implement defense in depth. Your future self (and your users) will thank you.

References

Frequently Asked Questions

What is a DoS vulnerability via unbounded data size?

It's a flaw where an application accepts unlimited amounts of data without validation, allowing attackers to send massive payloads that consume all available memory and crash the service.

How do you prevent DoS via unbounded data in Node.js?

Implement strict size limits on all incoming data, use streaming for large payloads, set timeouts, and keep HTTP client libraries like axios updated to versions with built-in protections.

What CWE is DoS via unbounded data size?

CWE-400: Uncontrolled Resource Consumption, which covers scenarios where applications fail to properly limit resource usage.

Is setting maxContentLength enough to prevent this vulnerability?

In vulnerable axios versions, the maxContentLength option existed but wasn't properly enforced. Upgrading to 1.12.0+ ensures these limits are actually respected.

Can static analysis detect DoS via unbounded data size?

Yes, tools like Trivy can identify vulnerable dependency versions through CVE databases, while SAST tools can flag missing size validation in custom code.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #429

Related Articles

critical

How Sensitive Data Exposure in Error Logging happens in TypeScript/Deno and how to fix it

A critical vulnerability in Supabase Edge Functions allowed sensitive authentication errors and API credentials to leak through verbose error logging. The `cancel-subscription/index.ts` function logged full error objects to the console, potentially exposing Paddle API keys and auth tokens in deployment logs. The fix sanitizes all error messages to log only safe error text while preserving debugging capability.

critical

How HTTP Header Injection Happens in Go and How to Fix It

A critical vulnerability in the file upload handler allowed attackers to inject CRLF sequences into HTTP response headers through crafted filenames. The fix sanitizes user-supplied filenames before using them in Content-Disposition headers, preventing header injection attacks that could lead to cache poisoning, session fixation, or XSS.

high

How Path Traversal and Security Policy Bypass Happens in Node.js Dependencies and How to Fix It

A high-severity vulnerability in the fast-uri package (CVE-2026-6321) allowed attackers to bypass security policies through improper Unicode hostname canonicalization and path traversal. This issue affected the @apralabs/apra-fleet project through its dependency tree, and was resolved by upgrading fast-uri from version 3.1.0 to 4.1.2 using npm overrides.

high

How Command Injection happens in Node.js child_process calls and how to fix it

A high-severity command injection vulnerability was discovered in `tools/utils/lang/helpers.ts` where the `prettier()` function passed a user-controllable `fileName` argument directly into a shell command string via `exec()`. By replacing `exec()` with `execFile()` and passing arguments as an array, the fix eliminates shell interpolation entirely, preventing attackers from injecting arbitrary shell commands through malicious filenames.

high

How Quadratic CPU Consumption in YAML Parsing happens in JavaScript and how to fix it

A high-severity vulnerability in js-yaml versions 3.x and 4.x allowed attackers to cause quadratic CPU consumption through specially crafted YAML documents using the `!!omap` type. This denial-of-service vulnerability (GHSA-5p4m-2wfm-xmqj) was fixed by upgrading from js-yaml 4.3.0 to 4.3.1, protecting applications from algorithmic complexity attacks during YAML parsing.

high

How Arbitrary HTTP Header Injection via Prototype Pollution happens in JavaScript and how to fix it

A high-severity vulnerability (CVE-2026-42035) in axios version 1.13.5 allowed attackers to inject arbitrary HTTP headers through prototype pollution. The fix upgrades axios to version 1.18.0 in the frontend's dependency tree, which includes proper prototype chain validation when constructing HTTP request headers. This prevents attackers from manipulating outgoing requests to perform SSRF, session hijacking, or cache poisoning attacks.