You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Records 2.0.3 as the first patched version, replacing last_affected: 2.0.2, and adds the upstream fix commit as a FIX reference.
Why the range needs changing
The advisory currently ends at last_affected: 2.0.2, which was accurate when it was published: 2.0.2 was the newest version in existence. A fix has since been released, so the range can now carry the stronger statement, and fixed is the field remediation tooling reads to construct an upgrade target. With only last_affected present, automated remediation has nothing to aim at and opens nothing, which is how this came to my attention.
The fix
Upstream commit e6e83a5578961de81f6d5834d90fb7430d8f29a5, "fix infinite loops to satisfy security theatre", touches lib/types/icns.ts, lib/types/jxl.ts and lib/types/heif.ts and adds three regression fixtures, one of which is specs/images/invalid/icns-zero-length-entry.icns, the exact input this advisory describes. It is the commit immediately before the 2.0.3 release commit fa82e6b9eeb33ad871a6f753319776b602161f85.
Verified in the bytes published to npm rather than inferred from the version number. image-size@2.0.2 has:
// dist/types/icns.mjswhile(imageOffset<fileLength&&imageOffset<inputLength){constimageHeader=readImageHeader(input,imageOffset)...imageOffset+=imageHeader[1]// a UInt32BE read from the file}
A zero entry length never advances imageOffset, which is the loop this advisory describes. image-size@2.0.3 adds the guard that makes the loop always advance:
2.0.3 is the first release containing it: 2.0.0, 2.0.1 and 2.0.2 do not, and 2.0.4 differs from 2.0.3 only by an unrelated bounds check in the ICO parser.
One thing a reviewer should know
The project has moved from GitHub to Codeberg. The PACKAGE reference still points at github.com/image-size/image-size, whose last push is 2026-06-03 and whose newest release is v2.0.2; the pull request this advisory cites resolves only through its web.archive.org snapshot. The active repository is codeberg.org/image-size/image-size, which is where the fix commit lives and why the FIX reference points there. 2.0.3 and 2.0.4 were published to npm on 2026-09-14 by the same maintainer account that published 2.0.2, and carry no upstream git tags. I have left the PACKAGE reference alone, since changing it is a separate improvement to a separate field, but it looks stale and you may want it.
The sibling advisory GHSA-5p2g-fcmc-qvqq covers the JXL and HEIF loops fixed by the same commit. It is submitted separately, per the one-advisory-per-pull-request rule in CONTRIBUTING.
Crafted ICNS: 100 bytes, magic icns, declared file length 100, one ic07 entry at offset 8 whose 4-byte length field at offset 12 is 0. Passed to imageSize():
version
result
2.0.2
hung — killed after 6118 ms, event loop never returned
2.0.3
threw TypeError: Invalid ICNS in 4 ms
2.0.2 advances with imageOffset += imageHeader[1], so a zero entry length leaves imageOffset at 8 and the loop condition stays true indefinitely while the images array grows without bound. 2.0.3's entryLength < 8 guard throws before that.
Same downstream cost as the sibling advisory: in aliyun/elastic-compute-control-cli Dependabot saw first_patched_version: null, opened no pull request, and the alert sat open from 2026-08-10 until a maintainer traced npm by hand and bumped the lockfile (#80, merged 2026-09-22). It flipped to fixed 4 seconds after the merge commit landed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Records
2.0.3as the first patched version, replacinglast_affected: 2.0.2, and adds the upstream fix commit as aFIXreference.Why the range needs changing
The advisory currently ends at
last_affected: 2.0.2, which was accurate when it was published: 2.0.2 was the newest version in existence. A fix has since been released, so the range can now carry the stronger statement, andfixedis the field remediation tooling reads to construct an upgrade target. With onlylast_affectedpresent, automated remediation has nothing to aim at and opens nothing, which is how this came to my attention.The fix
Upstream commit
e6e83a5578961de81f6d5834d90fb7430d8f29a5, "fix infinite loops to satisfy security theatre", toucheslib/types/icns.ts,lib/types/jxl.tsandlib/types/heif.tsand adds three regression fixtures, one of which isspecs/images/invalid/icns-zero-length-entry.icns, the exact input this advisory describes. It is the commit immediately before the2.0.3release commitfa82e6b9eeb33ad871a6f753319776b602161f85.Verified in the bytes published to npm rather than inferred from the version number.
image-size@2.0.2has:A zero entry length never advances
imageOffset, which is the loop this advisory describes.image-size@2.0.3adds the guard that makes the loop always advance:2.0.3is the first release containing it:2.0.0,2.0.1and2.0.2do not, and2.0.4differs from2.0.3only by an unrelated bounds check in the ICO parser.One thing a reviewer should know
The project has moved from GitHub to Codeberg. The
PACKAGEreference still points atgithub.com/image-size/image-size, whose last push is 2026-06-03 and whose newest release isv2.0.2; the pull request this advisory cites resolves only through itsweb.archive.orgsnapshot. The active repository iscodeberg.org/image-size/image-size, which is where the fix commit lives and why theFIXreference points there.2.0.3and2.0.4were published to npm on 2026-09-14 by the same maintainer account that published2.0.2, and carry no upstream git tags. I have left thePACKAGEreference alone, since changing it is a separate improvement to a separate field, but it looks stale and you may want it.The sibling advisory GHSA-5p2g-fcmc-qvqq covers the JXL and HEIF loops fixed by the same commit. It is submitted separately, per the one-advisory-per-pull-request rule in CONTRIBUTING.