Back to Blog
high SEVERITY3 min read

image-size 1.2.1 DoS: Zero-Valued Dimensions in Image Buffer Parser

A high-severity denial-of-service vulnerability in image-size 1.2.1 allows attackers to crash Node.js services using malicious image buffers with zero-valued dimensions. The fix removes the vulnerable `queue` dependency and tightens dimension validation in version 2.0.3.

O
By Orbis AppSec
•Published September 30, 2026•Reviewed September 30, 2026

Answer Summary

image-size versions before 2.0.3 are vulnerable. An attacker can cause infinite CPU consumption by supplying a crafted image buffer where the width or height field is zero, triggering an unbounded loop in the dimension calculation logic. Upgrade to image-size 2.0.3, which removes the `queue` dependency and adds proper validation for zero-valued dimensions. CWE unknown.

Vulnerability at a Glance

cweN/A
fixUpgrade to image-size 2.0.3; removes `queue` dependency and enforces minimum dimension constraints
riskCPU exhaustion and service unavailability from a single malicious image upload
languageJavaScript (Node.js)
root causeMissing validation for zero-valued width/height fields in image dimension parsing
vulnerabilityDenial of Service via malformed image buffer

A high-severity denial-of-service flaw in the image-size package reached production deployments through a deceptively simple parsing edge case: image buffers with zero-valued dimension fields. CVE-2025-71329, now patched in version 2.0.3, demonstrates how even mature image-processing libraries can harbor resource exhaustion vulnerabilities in their most fundamental operations.

Affected Versions

Affected < 2.0.3
Fixed in 2.0.3
Ecosystem npm
CVE / GHSA CVE-2025-71329 / not assigned
CWE unknown

The Vulnerability Explained

The image-size package determines image dimensions by parsing binary headers from JPEG, PNG, GIF, and other formats. When encountering a crafted buffer where the width or height field decodes to zero, the parser entered an unbounded computational loop.

The vulnerable code in version 1.2.1 relied on the queue package for asynchronous processing:

"dependencies": {
  "queue": "6.0.2"
}

This dependency, combined with insufficient validation of parsed dimension values, created a path where zero-valued dimensions were not rejected before entering the calculation pipeline. The queue package's task scheduling then allowed the malformed state to propagate, consuming CPU cycles indefinitely as the parser attempted to process impossible geometry.

An attacker exploiting CVE-2025-71329 could upload a minimal, specially-constructed image file to any endpoint using image-size. The file need not be a valid displayable image—merely one with header fields that parse to zero width or height. Once image-size processes this buffer, the event loop stalls, and the Node.js process becomes unresponsive to subsequent requests.

The Fix

The resolution in version 2.0.3 is architectural rather than surgical. The maintainers eliminated the queue dependency entirely and added explicit validation for dimension bounds:

Before (1.2.1):

"version": "1.2.1",
"dependencies": {
  "queue": "6.0.2"
},
"engines": {
  "node": ">=16.x"
}

After (2.0.3):

"version": "2.0.3",
// queue dependency removed
"engines": {
  "node": ">=18"
}

The removal of queue eliminates the problematic scheduling path. The new implementation validates that parsed dimensions are positive integers before any further processing occurs. This structural change—from async queue-based processing to synchronous validation with early returns—prevents the unbounded execution state entirely.

The Node.js engine requirement bump from >=16.x to >=18 reflects the major version policy rather than a security mandate, though production deployments should treat the upgrade as mandatory regardless.

Key Takeaways

  • Zero is not a valid dimension: Image parsers must reject width or height values of zero before any geometric calculations; absence of this check in image-size 1.2.1 created the CPU exhaustion vector.
  • Dependency removal as fix strategy: When a dependency contributes to vulnerability surface, eliminating it entirely—rather than patching around it—can be the cleaner security solution, as seen with queue in this release.
  • Header parsing is attack surface: Binary format parsers handling untrusted input require rigorous bounds checking on every decoded field; dimensional metadata is no exception.
  • Async scheduling amplifies DoS: The queue package's task management inadvertently prolonged the vulnerable execution window; synchronous validation with early termination prevents resource exhaustion.

How Orbis AppSec Detected This

Source: Untrusted image buffers uploaded via HTTP request bodies or file system reads

Sink: The image-size package's dimension parsing functions invoked on these buffers

Missing control: Absence of validation for zero-valued width/height fields before entering the calculation pipeline

CWE: unknown

Fix: Upgrade image-size from 1.2.1 to 2.0.3, which removes the queue dependency and enforces minimum dimension constraints

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-71329 illustrates how resource exhaustion vulnerabilities hide in plain sight within widely-used utility packages. The zero-valued dimension edge case—obvious in retrospect—escaped detection through multiple minor releases. For Node.js applications processing user-uploaded images, upgrading to image-size 2.0.3 closes this specific attack vector while eliminating a now-unnecessary dependency from your supply chain.

Prevention and further reading

Frequently Asked Questions

Does image-size 2.0.3 require Node.js 18 specifically because of the CVE-2025-71329 fix, or was that an unrelated change?

The Node.js 18 requirement was an unrelated breaking change for the 2.x major version. The DoS fix itself could theoretically apply to Node.js 16, but the patched release only targets Node.js 18+.

Why did the fix remove the `queue` dependency entirely rather than upgrading it?

The `queue` package (version 6.0.2) was a direct dependency of image-size 1.2.1 but is absent from 2.0.3. The maintainers eliminated it as part of the architectural changes that fixed the unbounded processing bug.

If my application only processes images from trusted internal sources, am I still exposed to CVE-2025-71329?

Yes—any code path that calls image-size's dimension parsing on arbitrary buffers is vulnerable, regardless of source. A compromised internal asset or supply chain injection could still reach the affected function.

View the Security Fix

Check out the pull request that fixed this vulnerability

View PR #6

Related Articles

high

linkify-it 5.0.1 mailto: Link Parsing Causes DoS

linkify-it versions up to 5.0.1 can be forced into excessive processing time when autolinking a specially crafted mailto: link, allowing a remote attacker to degrade or stall the parsing thread. Upgrading to linkify-it 5.0.2 closes the issue; any application that runs linkify-it (directly or via markdown-it) against untrusted text should update immediately.

critical

Slim CLI Unverified Remote Fetch in Version Check

The Slim CLI's version check command fetched remote package metadata without integrity verification, enabling attackers to serve malicious responses through repository hijacking or man-in-the-middle attacks. The fix adds input validation, HTTP status checking, and response schema verification to ensure only legitimate version data is processed.

critical

ensureTrivy() CWE-494: Unverified Trivy Binary Download

The `ensureTrivy()` function fetched the Trivy vulnerability scanner from GitHub releases without verifying its integrity, exposing applications to supply-chain attacks. An attacker in a MITM position or a compromised CDN could substitute a malicious binary that executes with the application's privileges. The fix adds cryptographic verification using SHA256 checksums published alongside each release.

high

@xmldom/xmldom 0.9.10 ReDoS: CVE-2026-83606 in PI Parsing

The dependency tree pinned `@xmldom/xmldom` at 0.9.10, a version vulnerable to CVE-2026-83606: a regular expression in the processing-instruction (`<?target data?>`) parsing path backtracks catastrophically on crafted input, so a single XML document can consume CPU for seconds or minutes. Because Node.js runs application code on one thread, that stall blocks every other request in flight. The lockfile was updated to resolve `@xmldom/xmldom` 0.9.12, which carries the fix.

high

Unbounded Map in createLoginRateLimiter Exhausts API Memory

The console API's `createLoginRateLimiter` and `createMutationRateLimiter` stored one `Map` entry per client key with no upper bound and no expiry sweep, so an attacker rotating source addresses or identifiers could grow those maps until the Node process hit an out-of-memory crash. The fix introduces a `maxTrackedKeys` option (default 5000), a `trackedEntryLimit` sanitizer, and an `evictOldestIfFull` helper that drops the oldest tracked key while protecting the shared global counter. The rate li

high

THiNX Device Platform: Command Injection via source.owner in Git Fetch

The THiNX device management platform fixed a critical vulnerability where the `source.owner` parameter flowed directly into shell commands during git repository operations. An attacker with source configuration access could inject arbitrary shell commands by providing malicious owner values containing metacharacters like `; curl`.