Skip to content

[GHSA-w3rx-r6r6-pgpr] image-size: ICNS parser allows denial of service through an infinite loop - #9473

Open
wojtekmaj wants to merge 1 commit into
wojtekmaj/advisory-improvement-9473from
wojtekmaj-GHSA-w3rx-r6r6-pgpr
Open

[GHSA-w3rx-r6r6-pgpr] image-size: ICNS parser allows denial of service through an infinite loop#9473
wojtekmaj wants to merge 1 commit into
wojtekmaj/advisory-improvement-9473from
wojtekmaj-GHSA-w3rx-r6r6-pgpr

Conversation

@wojtekmaj

Copy link
Copy Markdown

Updates

  • Affected products
  • CVSS v3
  • CVSS v4
  • Description

Comments
Please change the affected range from <= 2.0.2 to >= 0.6.3, <= 2.0.2. The missing lower bound incorrectly includes releases published before ICNS support existed. This correction does not exclude 1.0.2, which remains affected, and does not claim that a patched release exists.

I inspected published npm tarballs across the stable release history. The ICNS parser first appears as package/lib/types/icns.js in 0.6.3. The 0.6.2 tarball has no ICNS handler, and its package/lib/types.js does not register ICNS. In 0.6.3, calculate() already advances imageOffset using the unvalidated imageHeader[1], including inside the while loop. A zero-length entry therefore leaves the offset unchanged.

I reproduced the problem directly against the published 0.6.3 parser, using Buffer.from('69636e73000000106973333200000000', 'hex'): detect() returns true, then calculate() does not terminate normally and exhausts a deliberately bounded child-process heap. The same issue reproduces against 1.0.2 and subsequent sampled releases through 2.0.2.

Published source artifacts:
https://registry.npmjs.org/image-size/-/image-size-0.6.2.tgz
https://registry.npmjs.org/image-size/-/image-size-0.6.3.tgz
https://registry.npmjs.org/image-size/-/image-size-1.0.2.tgz
https://registry.npmjs.org/image-size/-/image-size-2.0.2.tgz
https://muort.390202.xyz/image-size/image-size/releases/tag/v0.6.3

Form limitation: the improvement form rejects the existing CVSS v4 vector with optional metrics set to X. I removed only those Not Defined suffixes to submit the form; no severity change is intended. The form also appears to discard an existing CVSS v3 entry when submitting in CVSS v4 mode. Please preserve the original severity entries during curation; this request is solely a version-boundary correction and matching description clarification.

Copilot AI balanced review requested due to automatic review settings September 12, 2026 15:50
@github-actions
github-actions Bot changed the base branch from main to wojtekmaj/advisory-improvement-9473 September 12, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The existing CVSS v3 severity entry must be restored as requested in the PR description.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Narrows the affected image-size range to versions containing the vulnerable ICNS parser.

Changes:

  • Sets the lower bound to 0.6.3.
  • Clarifies why earlier releases are unaffected.
  • Normalizes CVSS v4, but unintentionally removes CVSS v3.
File summaries
File Description
GHSA-w3rx-r6r6-pgpr.json Updates affected range, description, and severity data.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 12 to +14
{
"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"
"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"

@wojtekmaj wojtekmaj Sep 13, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. GitHub’s improvement form removed CVSS v3, and I can’t amend its generated branch. Please preserve the original severity data when reviewing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants