Review #15 P3 batch: Secrets (004–009, 011, 012, 014–016, 018, 019) #45

Closed
opened 2026-11-09 14:39:43 -05:00 by dohertj2 · 1 comment
Owner

P3 findings from the scadaproj#15 shared-library review (verified at 91fb2b4) — full description, failure scenario and fix for each in code-reviews/<Lib>/findings.md. Split out any that grow.

  • Secrets-004 — corrupt nonce/wrapped-key lengths escape Decrypt as ArgumentException (skips decryption-failed audit)
  • Secrets-005 — store-path rules are textual (C:secrets.db, \?, UNC, 8.3, symlinks pass)
  • Secrets-006 — resolver cache re-stores a stale value after Invalidate; expired plaintext never evicted
  • Secrets-007 — master key re-read per op, key/id not read atomically, never zeroed (wrong key id stamped on a row)
  • Secrets-008 — hub push sweep has no per-row isolation (one >450-char name blocks every later name)
  • Secrets-009 — README sample fails validation; empty/unterminated ${secret:} tokens pass through as the credential
  • Secrets-011 — HandleAnnounceTick publishes from a background thread (no sender; replies/faults lost)
  • Secrets-012 — Akka replies aren't chunked (cold rejoin exceeds the 128 KB frame)
  • Secrets-014 — UI Add silently overwrites an existing/deleted secret (audited as secret.add)
  • Secrets-015 — Reveal shows the value even when the audit write fails
  • Secrets-016 — UI components do no authorization check themselves; policy rules untested
  • Secrets-018 — bundle import stops partway with only 'Import failed'
  • Secrets-019 — cancelling a hub call raises RpcException(Cancelled); failover tries every endpoint with a cancelled token
P3 findings from the scadaproj#15 shared-library review (verified at 91fb2b4) — full description, failure scenario and fix for each in `code-reviews/<Lib>/findings.md`. Split out any that grow. - [ ] Secrets-004 — corrupt nonce/wrapped-key lengths escape Decrypt as ArgumentException (skips decryption-failed audit) - [ ] Secrets-005 — store-path rules are textual (C:secrets.db, \\?\, UNC, 8.3, symlinks pass) - [ ] Secrets-006 — resolver cache re-stores a stale value after Invalidate; expired plaintext never evicted - [ ] Secrets-007 — master key re-read per op, key/id not read atomically, never zeroed (wrong key id stamped on a row) - [ ] Secrets-008 — hub push sweep has no per-row isolation (one >450-char name blocks every later name) - [ ] Secrets-009 — README sample fails validation; empty/unterminated ${secret:} tokens pass through as the credential - [ ] Secrets-011 — HandleAnnounceTick publishes from a background thread (no sender; replies/faults lost) - [ ] Secrets-012 — Akka replies aren't chunked (cold rejoin exceeds the 128 KB frame) - [ ] Secrets-014 — UI Add silently overwrites an existing/deleted secret (audited as secret.add) - [ ] Secrets-015 — Reveal shows the value even when the audit write fails - [ ] Secrets-016 — UI components do no authorization check themselves; policy rules untested - [ ] Secrets-018 — bundle import stops partway with only 'Import failed' - [ ] Secrets-019 — cancelling a hub call raises RpcException(Cancelled); failover tries every endpoint with a cancelled token
dohertj2 added the type:review-findingpriority:p3 labels 2026-11-09 14:39:43 -05:00
Author
Owner

Fixed on main (all 13; Secrets stays 0.6.6, unpublished): 004+007 (34b1b20) malformed nonce/tag/key lengths fail as decryption errors (audit fires); key + id read once per op and zeroed — a 0.6.5-written row still decrypts (test). 005 (57ef43e) drive-relative, symlink, \?, \localhost\C$ and 8.3 paths into the content root rejected (Windows cases pass on windev). 006 (532a88c) in-flight resolve can't re-cache an old value after rotation; expired plaintext evicted; TTL 0 caches nothing. 008 (ea487d0) one hub-rejected row no longer blocks later names. 009 (d8081ef) empty/unterminated ${secret:} fails startup (names key, never value). 011/012 (049cc50) announce carries its sender; rows/pulls chunked ≤64 KB. 014 (ff7dcf4) Add refuses a live name. 015 (93692fb) Reveal fails closed — shown only if its audit succeeds (reversible choice). 016 (c9e5176) UI components check their own policy (+ real role-mapping test). 018 (8f7fa30) bundle import validates all before writing; partial failure names written rows. 019 (e5099aa) cancellation = shutdown, no endpoint cycling. Consumer changes: symlinked store paths + malformed refs now fail startup; Reveal hidden if audit fails; DefaultSecretResolver is IDisposable; MasterKeyProviderBase.ResolveKeyBytes must return a fresh buffer. Evidence: Secrets solution 623 passed / 20 skipped on macOS (re-run green after rebase); windev 4 suites incl. Secrets.Tests 280/2; each regression test fails with its fix reverted.

Fixed on main (all 13; Secrets stays **0.6.6, unpublished**): 004+007 (34b1b20) malformed nonce/tag/key lengths fail as decryption errors (audit fires); key + id read once per op and zeroed — a 0.6.5-written row still decrypts (test). 005 (57ef43e) drive-relative, symlink, \\?\, \\localhost\C$ and 8.3 paths into the content root rejected (Windows cases pass on windev). 006 (532a88c) in-flight resolve can't re-cache an old value after rotation; expired plaintext evicted; TTL 0 caches nothing. 008 (ea487d0) one hub-rejected row no longer blocks later names. 009 (d8081ef) empty/unterminated ${secret:} fails startup (names key, never value). 011/012 (049cc50) announce carries its sender; rows/pulls chunked ≤64 KB. 014 (ff7dcf4) Add refuses a live name. 015 (93692fb) Reveal fails closed — shown only if its audit succeeds (reversible choice). 016 (c9e5176) UI components check their own policy (+ real role-mapping test). 018 (8f7fa30) bundle import validates all before writing; partial failure names written rows. 019 (e5099aa) cancellation = shutdown, no endpoint cycling. **Consumer changes:** symlinked store paths + malformed refs now fail startup; Reveal hidden if audit fails; DefaultSecretResolver is IDisposable; MasterKeyProviderBase.ResolveKeyBytes must return a fresh buffer. Evidence: Secrets solution 623 passed / 20 skipped on macOS (re-run green after rebase); windev 4 suites incl. Secrets.Tests 280/2; each regression test fails with its fix reverted.
Sign in to join this conversation.