Skip to content

FLT-359 fix round 3 (Cedric): final-review findings

The findings are in docs/review-r4/.

Clean verdicts: Cedric (native review), Gronktayvius General and Susie. Findings: Jenny (four chunks) and Gronktayvius Red Team.

Same constraints as before: disabled by default, no network, no secrets, no fleet wiring. Clahadore commits, and nothing gets pushed. For every bug, write the failing test first and show it red, then fix it.

High

  1. m-of-n with m < n can never commit (Jenny J1, SqliteApprovalLedger.cs:95-110). TryCommitEffectAsync only succeeds for unanimity.
  2. Fix: inside BEGIN IMMEDIATE, read the registered person→challenge map. Then verify that the evidence is a non-empty, duplicate-free subset that matches the map, and that approvedBy satisfies the policy.
  3. Tests: 2-of-3 commits; a third approval doesn't double-commit; an unregistered challenge is denied; the same person twice is denied.
  4. Ledger directory hardening (Jenny J1, SqliteApprovalLedger.cs:20-36).
  5. Reject reparse points and junctions (LinkTarget).
  6. Apply the ACL and Unix mode before enumerating the directory.
  7. Verify the owner on Windows, then require the directory to be empty.
  8. Tests: a pre-existing non-empty directory is rejected; a junction is rejected.
  9. The visible message order can push the real target off-screen (Gronktayvius Red Team, TwilioProvider.cs:42-46).
  10. Order the message as Kind, Target, Ticket, command hash first, then EffectBinding, then Label.
  11. Hard-cap EffectBinding and every target field so the prefix always fits the display limit.
  12. Reject a MessageCharacterLimit above a conservative verified-viewport constant (the value needs live-doc verification). Remove the 4096 allowance.
  13. Tests: a maximum-length effect can't push Target out of the first N characters; a Stryker mutant that reorders the fields must be able to fail.
  14. The ApprovalRequest constructor bypasses Create's validation (Jenny J3, Models.cs:32, TwilioProvider.cs:42). Validate request/Action for non-null, a non-empty Jti, UTC offsets, and a lifetime greater than 0 and at most 30 minutes, at every entry point that consumes a request (provider, gate, executor). Otherwise return Invalid, never a NullReferenceException or ProviderUnavailable.

Medium

  1. Bound the size of untrusted input (Gronktayvius Red Team, Models.cs:98,146). Reject an action body larger than a few KB before JCS parsing, and cap the recipient count and each label's length. Test: a body just over the limit returns Invalid.
  2. TryRecordAsync(now) ignores now, so it fails open (Jenny J1, SqliteApprovalLedger.cs:82-83). Either remove it from IApprovalClock or validate and persist now inside BEGIN IMMEDIATE. Test: a rolled-back now returns false.
  3. Null or blank evidence becomes ProviderUnavailable instead of Invalid (Jenny J2, Approvers.cs:8,36,98,102,147). Guard nulls and blank IDs. Run the bipartite match before fanning out to the provider.
  4. Twilio time precision (Jenny J3, Models.cs:38, TwilioProvider.cs:28,124). Normalize CreatedUtc and ExpiresUtc to whole seconds, set a minimum lifetime of about 60 s, and compare at second precision.
  5. Outbox marker (Jenny J4, Notifications.cs:154-158). Scope the IOException-exists catch to the CreateNew call only.
  6. EmailNotifier: add a log callback for the timeout, and move SendAsync inside the try block (Jenny J4, Notifications.cs:107,131,137).
  7. FileRequestStore: Load honours its nullable return, and Save writes atomically via temp file plus move (Jenny J1).
  8. CI: use a trx LogFilePrefix instead of a fixed LogFileName (Jenny J4, ci.yml:29).

Answer any you reject in docs/review-r4/RESPONSES.md, with reasoning.

Verify

Run dotnet build --no-restore -warnaserror and dotnet test --no-restore. Use -p:OutputPath=bin/R5/ if the DLLs are locked. Final message: the bugs that had a red test first, what changed, and the real output tails.