Vulnerabilities in pkg:npm/image-size

PACKAGE
Advisory Identifier: GHSA-5p2g-fcmc-qvqq
Advisory Summary

CVE-2025-71329 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 jxl and heif parsers allow denial of service through infinite loops. Remediation is available by upgrading affected packages to version 2.0.3.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/image-size

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/image-size. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-5p2g-fcmc-qvqq CVE-2025-71329 HIGH image-size: JXL and HEIF parsers allow denial of service through infinite loops
GHSA-w3rx-r6r6-pgpr CVE-2025-71330 HIGH image-size: ICNS parser allows denial of service through an infinite loop
GHSA-m5qc-5hw7-8vg7 CVE-2025-71319 HIGH image-size Denial of Service via Infinite Loop during Image Processing

CVE-2025-71329 at a Glance

CVE Identifier CVE-2025-71329
GHSA Identifier GHSA-5p2g-fcmc-qvqq
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-71329

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-71329, 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 image buffer with a zero-valued size field in a recognized box-type. Attackers can trigger an infinite loop in the JXL or HEIF image parsers by providing a crafted image containing a box with a size of zero, causing the offset to never advance and permanently hanging the application.

CVE-2025-71329 Affected image-size Versions

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

References

Frequently Asked Questions

What is CVE-2025-71329?
CVE-2025-71329 is a security vulnerability in image-size involving JXL and HEIF parsers allow denial of service through infinite loops 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-71329?
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-71329?
CVE-2025-71329 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-71329?
CVE-2025-71329 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-71329?
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-5p2g-fcmc-qvqq",
  "modified" : "2026-09-24T18:28:03Z",
  "published" : "2026-06-10T15:31:30Z",
  "aliases" : [ "CVE-2025-71329" ],
  "summary" : "image-size: JXL and HEIF parsers allow denial of service through infinite loops",
  "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 image buffer with a zero-valued size field in a recognized box-type. Attackers can trigger an infinite loop in the JXL or HEIF image parsers by providing a crafted image containing a box with a size of zero, causing the offset to never advance and permanently hanging the application.",
  "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "image-size"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.2.0"
      }, {
        "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-71329"
  }, {
    "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-infinite-loop-in-jxl-heif-parser"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-07T20:54:40Z",
    "nvd_published_at" : "2026-06-10T14:16:30Z"
  }
}