Skip to content

fix(security): verify on-disk catalog cache signature on startup load - #25

Merged
xt0n1-t3ch merged 1 commit into
mainfrom
fix/issue-20-verify-cache
Jun 17, 2026
Merged

fix(security): verify on-disk catalog cache signature on startup load#25
xt0n1-t3ch merged 1 commit into
mainfrom
fix/issue-20-verify-cache

Conversation

@xt0n1-t3ch

Copy link
Copy Markdown
Owner

Summary

Closes #20. At startup the app read the cached catalog directly into state.catalog without verifying its Ed25519 signature, so a locally modified Cache/catalog.json could influence DLL download destinations before a verified refresh. This routes the startup load through a signature-required loader and falls back to the signed embedded manifest when the cache cannot be verified.

Changes

  • crates/dll-catalog/src/lib.rs: add pub fn load_verified_cache() that always requires the .sig sidecar to verify; load_cached_catalog keeps its enforcement-gated behavior for the fetch-with-cache path via a shared helper. New test: a cache whose sidecar is signed with the wrong key is rejected.
  • src-tauri/src/lib.rs: startup loads through load_verified_cache(); on missing/invalid/unsigned cache, falls back to embedded_fallback_catalog() instead of trusting unverified bytes.

Proof

  • cargo test -p dll-catalog -> 55 passed (incl. verified_cache_rejects_sidecar_from_wrong_key)
  • cargo check -p dlssync and cargo check -p dlssync --features nexus -> Finished
  • cargo clippy -p dll-catalog -- -D warnings -> clean
  • cargo fmt --all -- --check -> clean

Closes #20

At startup the app read the cached catalog directly into state without
verifying its Ed25519 signature, so a locally modified cache could influence
DLL download destinations before a verified refresh.

- dll-catalog: add pub load_verified_cache() that always requires the sidecar
  signature to verify (load_cached_catalog keeps its enforcement-gated
  behavior for the fetch-with-cache path via a shared helper)
- src-tauri: load the startup cache through load_verified_cache(); on a
  missing/invalid/unsigned cache, fall back to the signed embedded manifest
  instead of trusting unverified bytes
- test: a cache whose sidecar is signed with the wrong key is rejected

Closes #20
@xt0n1-t3ch
xt0n1-t3ch merged commit 2aba1a0 into main Jun 17, 2026
3 checks passed
@xt0n1-t3ch
xt0n1-t3ch deleted the fix/issue-20-verify-cache branch June 17, 2026 05:18
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.

fix(security): verify on-disk catalog cache signature on startup load

1 participant