Fix: Percy CLI hangs on Node.js 26 during Chromium extraction — adm-zip variant (PER-10062)#2344
Open
prklm10 wants to merge 5 commits into
Open
Fix: Percy CLI hangs on Node.js 26 during Chromium extraction — adm-zip variant (PER-10062)#2344prklm10 wants to merge 5 commits into
prklm10 wants to merge 5 commits into
Conversation
…rage break) Master's Test @percy/core job has been red since a4b6b8a — global 100% coverage fails on src/utils.js:103, the canonicalHost catch for colon-containing hosts that are not valid IPv6. No spec fed such a host through the metadata gates. Adds one isMetadataIP spec ('abc:def') that deterministically exercises the fallback on Node 14/20/26. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…a callers) Second half of the master coverage break: the falsy-host guard in canonicalHost is unreachable — matchMetadataHost early-returns on falsy hosts before calling it and METADATA_IPS maps hardcoded literals. Kept as a defensive no-op with an ignore pragma per repo convention. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… (PER-10062) Chromium archive extraction hangs forever on Node.js 26 because extract-zip@2.0.1 depends on yauzl@2, which relies on undefined stream destroy() behavior that Node 26 tightened — openReadStream callbacks never fire on deflate entries (thejoshwolfe/yauzl#176). adm-zip inflates synchronously and is unaffected. adm-zip's own extractAllTo is not used: verified on Node 26 it writes symlink entries as regular files containing the target path (breaking the Chromium.app bundle) and mishandles windows-style directory attributes. The local unzip module iterates getEntries() and restores modes, directories, and symlinks itself, with a zip-slip guard. Verified: 10 unzip specs (deflate, symlinks, exec modes, windows dirs, corrupted data, zip-slip) pass on Node 14 and Node 26; 100% coverage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ninadbstack
approved these changes
Jul 17, 2026
CodeQL js/zipslip does not model split(sep).includes('..') as a barrier;
path.relative(dir, dest).startsWith('..') is its recognized
RelativePathStartsWithSanitizer shape. Same rejection semantics.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| // `dir` is the trusted install target from install.js, not user input, | ||
| // and entry names are validated by the traversal guard below | ||
| // nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal | ||
| let dest = path.join(dir, entry.entryName); |
| // `dir` is the trusted install target from install.js, not user input, | ||
| // and entry names are validated by the traversal guard below | ||
| // nosemgrep: javascript.lang.security.audit.path-traversal.path-join-resolve-traversal.path-join-resolve-traversal | ||
| let dest = path.join(dir, entry.entryName); |
… specs The exec:start specs waited a fixed 1s after start() before pinging, but request() only retries ECONNREFUSED 5 times at 50ms intervals, so on slow Windows runners where the server takes longer to bind the specs fail with EEXIT: 1 (flaking on master too, not specific to this branch). Replace the sleep with a healthcheck poll bounded at 15s (within the 25s Windows jasmine timeout). 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.
Fixes PER-10062. Alternative implementation to #2343 — same root cause and test contract, different extraction library. Pick one.
Root cause
Identical to #2343:
extract-zip@2.0.1→yauzl@2relies on undefined streamdestroy()behavior that Node.js 26 tightened, soopenReadStream()callbacks never fire on deflate entries and Chromium extraction hangs forever (thejoshwolfe/yauzl#176).percy execblocks before spawning the wrapped command → no tests run, builds finalizeno_snapshots.Fix
Replaces
extract-zipwith a localpackages/core/src/unzip.jsbuilt onadm-zip@^0.6.0, which inflates synchronously and is unaffected by the Node 26 stream change.Why not adm-zip's own
extractAllTo: verified on Node 26 that it writes symlink entries as regular files containing the target path — this breaks theChromium.appbundle on macOS (framework symlinks) — and mishandles windows-style directory attributes. The wrapper iteratesgetEntries()and restores file modes, directories, and symlinks itself, with a zip-slip guard (reachable here, unlike with yauzl 3 which pre-validates entry names).Trade-offs vs #2343 (yauzl@3)
pend.getData()CRC-validates every entry (corrupted data throws instead of writing bad files).Testing
unzip.test.jscontract as Fix: Percy CLI hangs on Node.js 26 during Chromium extraction (PER-10062) #2343 (hand-crafted zip fixtures: stored + deflated entries, nested dirs,__MACOSX/skip, zip-slip rejection, default + executable modes, symlinks, windows dir attrs, corrupted data): pass on Node 14.21.3 and Node 26.5.0, 100% coverage on the new module.🤖 Generated with Claude Code