Repository navigation
Conversation
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.
readManifestSigningKeyOrThrowread the private key withreadFileSync(resolved, "utf8"), which follows a symbolic link at the key path. Manifest verification already refuses a final-component symlink (hashArtifactBytesSyncinmanifest-verify.ts), and the project config reader opens withO_NOFOLLOW; the signing-key read was the one security-relevant read in core that still followed a link.What changed
readManifestSigningKeyOrThrowinsrc/core/manifest-signing.tsnowlstats the resolved path first and refuses a symlink or a non-regular file with a message that says symlinks are not followed, matching the rule the verifier applies to artifacts.tests/manifest-signing.test.tsgains a symlinked-key case that asserts the refusal. It is skipped on Windows, where the other symlink tests in the suite also skip.Why this matters
A signing key is a security-relevant read, and a key path that quietly aliases another file is exactly what the final-component-symlink rule exists to catch. Bringing the signing-key read under the same rule keeps every key and artifact read in core on one policy.
Tests
npx vitest run tests/manifest-signing.test.ts tests/verify-manifest-command.test.ts tests/verify-manifest-pinned-key.test.ts tests/one-click-defend.test.tspasses, 24 tests with 1 skipped.Compatibility
A regular key file reads exactly as before. A symlinked key path that used to be followed now throws a named error instead of reading the link target.