Repository navigation
fix(artifacts): compare package signatures without ASCII folding - #2069
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks done
This was referenced Oct 12, 2026
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
Reject high-bit aliases of PKG/DMG signatures at artifact inventory and binary-target admission. Node's
Buffer.toString("ascii")clears bit 7:f8 61 72 21decodes asxar!, andeb 6f 6c 79askoly. These are not the format signatures but currently select the package routes.Problem and expected behavior
A
.pkgwith the former four bytes is reported as PKG; a 512-byte.dmgwith the latter at its trailer is reported as DMG. Classification must compare the observed bytes exactly. Found while inspecting the admission boundary; no separate issue exists.Change and scope
Replace the four lossy string comparisons with exact buffer equality in the two existing admission paths. Keep their suffix, read-length, and trailer-location requirements. No package decoder or execution path is added.
Contract and boundary impact
BinaryTargetResolver.Evidence and regression coverage
Real filesystem fixtures cover valid signatures plus an independent bit-7 mutation of each signature byte through both
classifyAndHashRootandparseBinaryTarget. Base3bdc8730fails both new cases (12 existing pass); the fix passes all 14. Current upstream4573e8cfchanges neither owner.This validates static admission, not complete XAR/UDIF validity or native package mounting. No real Hopper/Ghidra/browser verification is applicable.
Validation performed
Node 24.18.0 / npm 11.16.0, macOS arm64:
npm run test:focused -- tests/boundary/filesystem/zipDetection.test.ts— 14 passed; includes build preparation.npm run check— passed, lint warnings and zero errors.npm run docs:check— passed.check:fastandgit diff --check— passed.Compatibility, safety, and release
No breaking API, migration, package metadata, or authority changes. Invalid files may now yield the ordinary file classification or a
BinaryTargetErrorinstead of a false package format. Full suite and native mounting were not run.Review checklist
AI-assisted with Codex.