Skip to content

fix: verify plaintext blob identities on read - #554

Open
magrathean-uk wants to merge 1 commit into
rustic-rs:mainfrom
magrathean-uk:fix/verify-restored-blob-ids
Open

fix: verify plaintext blob identities on read#554
magrathean-uk wants to merge 1 commit into
rustic-rs:mainfrom
magrathean-uk:fix/verify-restored-blob-ids

Conversation

@magrathean-uk

Copy link
Copy Markdown
Contributor

Summary

  • verify decrypted and decompressed packed blob bytes against their expected content-addressed ID
  • carry expected IDs through tree, dump, restore, and normal copy reads
  • reject mismatched locally reused restore content with a verification error
  • retain fast-repack's documented unchecked behavior

Why

AEAD authenticates a ciphertext record, but does not bind that record to its index identity. A valid record stored at the wrong indexed location could therefore be accepted as another blob when its size metadata also matched. Hashing plaintext before consumption prevents silent substitution and cache poisoning.

Validation

  • replay regression: compressed and uncompressed records
  • cargo test --locked -p rustic_core --lib: 169 passed
  • cargo clippy --locked --all-targets --all-features --workspace -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check
  • typos on all changed files

The full workspace integration run reached 52 passing tests; five snapshot comparisons differed only because macOS added com.apple.provenance xattrs to local fixtures.

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