Skip to content

Code-review fixes: grace cache hardening, live revocation freshness, docs/hygiene - #11

Merged
skalvinnathan merged 1 commit into
mainfrom
fix/review-2026-11
Nov 15, 2026
Merged

skalvinnathan merged 1 commit into
mainfrom
fix/review-2026-11

Conversation

@skalvinnathan

Copy link
Copy Markdown
Member

A full end-to-end review (three independent reviewers: security/protocol, correctness/robustness, usability/docs) found issues concentrated in the recently-added online/revocation code. This fixes the verified ones.

Security / correctness

  • Grace cache (was the biggest): cached the per-license secret under a locally-derivable key with plaintext timestamps → a root licensee could recover a reusable secret or extend the window. Now caches the content key (per-build, already in the running app) and authenticates cached_at/not_after in the AEAD AAD, enforcing both and the window. Editing the on-disk timestamps now fails the open.
  • Live revocation freshness: cryptship-server re-reads --revoke-file on every request (the old mtime/size cache could miss a same-byte-length edit and keep honouring a just-revoked license). Warns once if the file becomes unreadable.
  • Grace timer refreshes only on a signed "active" answer (an unsigned captive-portal 200 can no longer extend grace).
  • Server wipes the per-license secret after signing; signing_key_id is bound into the signed response/check inputs.
  • Loader drops the separate extract-marker file (recognises its dir by the manifest) — removes an O_EXCL collision if a payload ships that filename.
  • cryptship propagates crypto/rand errors when generating ids.

Docs / hygiene

  • Add SECURITY.md (private disclosure + honest scope), CONTRIBUTING.md, CHANGELOG.md; linked from README.
  • README go install now targets cryptship + cryptship-server only (not the loader); roadmap corrected (online grace is shipped).
  • HOWTO: fingerprint is Linux-only; document the cryptship_devfp / CRYPTSHIP_FINGERPRINT dev hatch and the -- <command> default.
  • ARCHITECTURE: honest grace trade-off.

Tests

New: grace timestamp-tamper rejection, same-length --revoke-file swap. Full go test -race ./..., vet, gofmt, mermaid, and all three demos (baseline/compiled/online) pass.

Validated as sound (no change)

v2 KEK-context binding stops claim tampering + v2→v1 downgrade; online response verification is complete; tar extraction is hardened; check ordering is correct. Still roadmap (hardware/protocol): real SEV-SNP/TDX verifier + attested replay fix, memfd extraction.

… nits

From a full end-to-end code review (three independent reviewers):

Security / correctness:
- grace cache: store the content key (not the per-license secret); authenticate
  cached_at/not_after in the AEAD AAD and enforce both plus the window.
- cryptship-server re-reads --revoke-file every request (no mtime/size cache that
  could miss a same-length edit); warns once if it becomes unreadable; wipes the
  per-license secret after signing.
- revocation grace timer refreshes only on a signed answer.
- bind signing_key_id into the signed response/check inputs.
- loader: drop the extract-marker file (recognise the dir by the manifest) to
  avoid an O_EXCL collision with payload contents.
- cryptship: propagate crypto/rand errors when generating ids.

Docs / hygiene:
- add SECURITY.md, CONTRIBUTING.md, CHANGELOG.md; link from README.
- README: go install targets cryptship + cryptship-server only; roadmap fixed.
- HOWTO: fingerprint is Linux-only; document the cryptship_devfp dev hatch and
  the "-- <command>" default.
- ARCHITECTURE: honest grace trade-off.

Tests: grace timestamp-tamper rejection, same-length revoke-file swap.
@skalvinnathan
skalvinnathan merged commit 9c6fcaf into main Nov 15, 2026
2 checks passed
@skalvinnathan
skalvinnathan deleted the fix/review-2026-11 branch November 15, 2026 18:14
skalvinnathan added a commit that referenced this pull request Nov 15, 2026
Implement IMPROVEMENTS.md items 1-8 and 12 (rest after #10/#11)
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.

1 participant