docs(guard): relabel integrity sidecars as integrity-not-authenticity (#19)#41
Merged
Conversation
…#19) The .integrity sidecars for pins.json and guard-policy.yaml are UNKEYED SHA-256 checksums stored beside the file with the same 0o600 perms. They provide INTEGRITY (tamper-evidence vs accidental corruption / cross-machine copies / a different OS-user account), NOT AUTHENTICITY vs a same-user/postinstall attacker: any process that can write the file can also recompute and rewrite the sidecar to match, so there is no attacker/writer asymmetry. The prior comments in pins.ts/policy.ts and the 2026-05-17 Decisions Log row implied these stop a malicious npm postinstall / same-user process. They do not. A keyed scheme (HMAC/signature) needs a secret the writable store lacks — the same constraint as the secret store (issue #15) — so the honest fix is relabel-only: docs + comments, no behavior change. docs/GUARD.md and docs/POLICY.md already stated this correctly; this reconciles the code comments and the Decisions Log. - pins.ts / policy.ts: clarify integrity-not-authenticity at sidecar header + fileSha sites; cite #19. - CLAUDE.md: reconcile the 2026-05-17 sidecar row + add a 2026-06-02 Decisions Log row recording the relabel decision. - pins.test.ts: add tests pinning the honest wording (fail on pre-fix source). Closes #19 Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
What
The
.integritysidecars forpins.jsonandguard-policy.yamlare unkeyed SHA-256 checksums stored next to the file with the same0o600permissions. This PR relabels them honestly as providing integrity (tamper-evidence), not authenticity against a same-user/postinstall attacker — and reconciles the contradictory Decisions Log row.Docs/comments only — no behavior change. The checksum-compare-and-throw logic is unchanged and correct as tamper-evidence.
Files touched (in scope):
src/guard/pins.ts— clarify integrity-not-authenticity at the sidecar header +fileShasite; cite [security][MEDIUM] Integrity sidecars are unkeyed SHA-256 — no protection vs same-user/postinstall tampering #19.src/guard/policy.ts— same relabel at the F4 sidecar comment +fileShasite.CLAUDE.md— reconcile the self-contradictory 2026-05-17 sidecar row and add a 2026-06-02 Decisions Log row recording the relabel decision.src/guard/__tests__/pins.test.ts— add tests pinning the honest wording.Why
The sidecars are unkeyed, so any process that can write the file can also recompute and rewrite the sidecar to match — there is no attacker/writer asymmetry. The prior code comments and the 2026-05-17 Decisions Log row claimed protection against a malicious npm
postinstall/ same-user process ("Sidecar protects against same-machine tampering (postinstall scripts, malware)"), which is false and self-contradictory (postinstall scripts are same-user).A keyed scheme (HMAC/signature) needs a secret the writable store lacks — the same constraint as the secret store (issue #15) — so the honest fix is relabel-only.
docs/GUARD.mdanddocs/POLICY.mdalready stated this correctly; this reconciles the code comments and the Decisions Log to match.Satisfies the issue's acceptance criteria: docs no longer claim protection against malicious same-user processes, and the decision is recorded in
CLAUDE.md.Test plan
pnpm lint(tsc) passespnpm test— 1115 passed (added 2 wording-contract tests)pnpm buildsucceeds#19reference are present and the prior overclaiming phrasing is gone.Closes #19
🤖 Generated with Claude Code