fix(deps): patch image-size DoS CVE-2025-71329 / CVE-2025-71330 via vendored fork - #13
Closed
revopushbot wants to merge 1 commit into
Closed
fix(deps): patch image-size DoS CVE-2025-71329 / CVE-2025-71330 via vendored fork#13revopushbot wants to merge 1 commit into
revopushbot wants to merge 1 commit into
Conversation
…endored fork Upstream image-size is archived with no patched release (every published version <= 2.0.2 is in the vulnerable range) and metro, which requires image-size@^1.0.2, declined to replace it. A version bump is therefore impossible, so this vendors image-size 1.2.1 into vendor/image-size as version 2.0.3 with the two infinite-loop fixes applied: - CVE-2025-71330 (GHSA-w3rx-r6r6-pgpr): the ICNS parser now rejects entry lengths smaller than the 8-byte entry header instead of looping forever on a zero length field. - CVE-2025-71329 (GHSA-5p2g-fcmc-qvqq): the JXL partial-stream extractor now always advances past the 8-byte box header when a jxlp box declares a zero size instead of re-reading the same box forever. The fork is forced through npm overrides and yarn resolutions, so both lockfiles now resolve image-size to the patched 2.0.3 copy. Jest regression tests reproduce both advisories' crafted buffers (verified to hang the unpatched 1.2.1) and assert the parsers terminate. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Resolves the four findings for
image-size <= 2.0.2(CVE-2025-71330 / GHSA-w3rx-r6r6-pgpr and CVE-2025-71329 / GHSA-5p2g-fcmc-qvqq) across both lockfiles.Why not a version bump like previous fixes
<= 2.0.2) is inside the vulnerable range.metro(transitive viaexpo → @expo/metro) requiresimage-size@^1.0.2and its maintainers closed the alert as not planned (Dependabot alerts: image-size Denial of Service via Infinite Loop during Image Processing react/metro#1607) and abandoned the replacement PR (fix(metro): replace unmaintained image-size dependency react/metro#1800).With no fixable version anywhere, this PR vendors a patched fork instead.
What this does
vendor/image-size/— a copy ofimage-size@1.2.1(the exact version metro consumed, same 1.x API) versioned 2.0.3 (the next version above the top of the vulnerable range), with two patches applied (documented invendor/image-size/PATCHES.md):TypeErrorfor entry lengths smaller than the 8-byte entry header, which can never be valid.extractPartialStreamssetoffset = box.offset + box.size; a zero-sizedjxlpbox never advanced the offset andfindBoxkept returning the same box. The offset now always advances by at least the 8-byte box header. (The HEIF path only iterates viafindBox, which already carried the equivalent guard since 1.2.1.)package.json— the fork is declared as afile:devDependency and forced onto metro through npmoverrides($image-sizereference form, since relativefile:overrides resolve against the dependent package) and yarnresolutions.image-size@1.2.1is gone from both;package-lock.jsonlinksnode_modules/image-sizetovendor/image-size@2.0.3andyarn.lockresolvesimage-size@file:./vendor/image-sizeat 2.0.3. yarn regeneration also picked up incidentalbrace-expansionpatch bumps (1.1.17→1.1.18, 2.1.3→2.1.4), same as previous dependency PRs.vendor/image-size/test/security-patches.test.jsfeeds both advisories' crafted buffers to the parsers and asserts they terminate. Both buffers were verified to hang the unpatched 1.2.1 for 5+ s before being killed, and the suite runs as part ofnpm test.Verification
npm ls image-size→image-size@2.0.3 overridden -> ./vendor/image-size(metro deduped to the same copy)npm test✅ (2 tests) ·npm run build✅ ·npm run lint✅ (0 errors; 192 pre-existing warnings insrc/withRevopush.ts)If upstream is ever revived (the maintainer mentioned continuing on Codeberg) or metro replaces the dependency, the vendor directory and override can simply be deleted.
🤖 Generated with Claude Code