Security review of the crypto and blob-generation seams #73
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
README:409-414 already names a security audit as the number one pre-1.0
blocker. This issue tracks it.
The crypto path is the least-tested part of the codebase relative to its
risk:
internal/cryptohas 178 test LOC andinternal/blobgen190,between them covering the entire compress → encrypt → hash writer and the
matching reader. For comparison,
internal/databasehas 4,203.Scope
Review, with findings written up on this issue:
agerecipient/identity plumbing end to end. Confirmthe private key is never required, read, or logged on the backup path.
config.AgeSecretKey(internal/config/config.go:132) puts a privatekey on the backed-up host when set — audit every use, and confirm it is
optional in fact and not just in intent. Note that #64 concerns a code
path currently gated on this field.
repeat across blobs or across runs.
plaintext is acted on, or is there anywhere plaintext is used ahead of
its tag being checked?
internal/types(229 lines of ID/hash newtypes withdriver.Valuer/sql.Scanner) sits on the DB boundary with zerotests — a faulty
Scansilently corrupts restores. Audit and test.what it leaks (compressed-size side channel) rather than leaving it
implicit.
plaintext reaches logs or error strings, including at
--debug.content-derived; document what that reveals to an observer of blob
sizes.
Definition of done
on this issue — including the ones that come back clean. "No issue
found in X" is a required output, not an omission.
internal/crypto,internal/blobgen, andinternal/typesreachcoverage proportionate to their risk, including negative tests: wrong
key, truncated ciphertext, corrupted tag, wrong recipient, empty
input, and boundary-size inputs.
assessment and linked here. Do not fix silently inside this issue.
docs/so users can evaluate them, and cross-referenced from thethreat-model section (see #67, which corrects the privacy docs).
make checkgreen.Note
This is a review issue, so its output is findings plus tests, not a
refactor. If the review concludes the design is sound, that conclusion —
written down with reasoning — is a complete and successful outcome.