Skip to content

docs(guard): relabel integrity sidecars as integrity-not-authenticity (#19)#41

Merged
m1ngshum merged 1 commit into
mainfrom
fix/issue-19-sidecar-honesty
Jun 2, 2026
Merged

docs(guard): relabel integrity sidecars as integrity-not-authenticity (#19)#41
m1ngshum merged 1 commit into
mainfrom
fix/issue-19-sidecar-honesty

Conversation

@m1ngshum

@m1ngshum m1ngshum commented Jun 2, 2026

Copy link
Copy Markdown
Member

What

The .integrity sidecars for pins.json and guard-policy.yaml are unkeyed SHA-256 checksums stored next to the file with the same 0o600 permissions. 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):

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.md and docs/POLICY.md already 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) passes
  • pnpm test — 1115 passed (added 2 wording-contract tests)
  • pnpm build succeeds
  • New tests fail on pre-fix source (verified via stash) — they assert the integrity-not-authenticity relabel + #19 reference are present and the prior overclaiming phrasing is gone.

Closes #19

🤖 Generated with Claude Code

…#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]>
@m1ngshum m1ngshum merged commit 406a64f into main Jun 2, 2026
7 checks passed
@m1ngshum m1ngshum deleted the fix/issue-19-sidecar-honesty branch June 2, 2026 08:17
@m1ngshum m1ngshum mentioned this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[security][MEDIUM] Integrity sidecars are unkeyed SHA-256 — no protection vs same-user/postinstall tampering

1 participant