CVE-2025-71330: image-size Denial of Service Vulnerability

HIGH
Advisory Identifier: GHSA-w3rx-r6r6-pgpr
CVSS 7.5
CWE-835
Published
Advisory Summary

CVE-2025-71330 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting image-size libraries in the npm ecosystem. The issue involves icns parser allows denial of service through an infinite loop. Remediation is available by upgrading affected packages to version 2.0.3.

CVE-2025-71330 at a Glance

CVE Identifier CVE-2025-71330
GHSA Identifier GHSA-w3rx-r6r6-pgpr
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product image-size
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2025-71330

To remediate this vulnerability, upgrade all affected image-size dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

image-size fixed: 2.0.3
npm install image-size@2.0.3
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 image-size

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-71330, inspect your project dependencies using npm:

npm ls image-size

Analyze the terminal output to locate any version of image-size in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.3), your application is affected.

Note: The npm ls image-size 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-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In image-size, 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

image-size through 2.0.2 contains a denial of service vulnerability that allows remote attackers to permanently block the Node.js event loop by supplying a specially crafted ICNS image buffer. Attackers can craft an ICNS buffer containing valid magic bytes and a zero-valued entry length field to trigger an infinite loop in the ICNS parser, as the offset is never incremented when the entry length field is 0, causing the while loop condition to remain true indefinitely.

CVE-2025-71330 Affected image-size Versions

1 component(s)
Fixed Versions:
2.0.3
Product / Package Ecosystem Affected Versions Fixed Version
image-size
npm
≥ 0.6.3
< 2.0.3
2.0.3

References

Frequently Asked Questions

What is CVE-2025-71330?
CVE-2025-71330 is a security vulnerability in image-size involving ICNS parser allows denial of service through an infinite loop under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which image-size versions are affected?
Affected versions include releases prior to 2.0.3 across affected packages: image-size.
What version fixes CVE-2025-71330?
Upgrading to 2.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is image-size affected?
Yes, image-size is affected in releases prior to 2.0.3. Upgrade your dependency to 2.0.3 or later.
What is the CVSS score of CVE-2025-71330?
CVE-2025-71330 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2025-71330?
CVE-2025-71330 is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') (The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.).
How can I check npm dependencies for CVE-2025-71330?
Run the dependency tree command: 'npm ls image-size'. 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-w3rx-r6r6-pgpr",
  "modified" : "2026-09-24T18:23:10Z",
  "published" : "2026-06-10T15:31:30Z",
  "aliases" : [ "CVE-2025-71330" ],
  "summary" : "image-size: ICNS parser allows denial of service through an infinite loop",
  "details" : "image-size through 2.0.2 contains a denial of service vulnerability that allows remote attackers to permanently block the Node.js event loop by supplying a specially crafted ICNS image buffer. Attackers can craft an ICNS buffer containing valid magic bytes and a zero-valued entry length field to trigger an infinite loop in the ICNS parser, as the offset is never incremented when the entry length field is 0, causing the while loop condition to remain true indefinitely.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "image-size"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.6.3"
      }, {
        "fixed" : "2.0.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.2"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-71330"
  }, {
    "type" : "WEB",
    "url" : "https://codeberg.org/image-size/image-size/commit/e6e83a5578961de81f6d5834d90fb7430d8f29a5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/image-size/image-size"
  }, {
    "type" : "WEB",
    "url" : "https://joshua.hu/image-size-infinite-loop-dos-vulnerabilities"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20260224152152/https://github.com/image-size/image-size/pull/439"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/image-size-denial-of-service-via-malformed-icns-image-parsing"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-07T20:55:24Z",
    "nvd_published_at" : "2026-06-10T14:16:30Z"
  }
}