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¶
- m-of-n with m < n can never commit (Jenny J1,
SqliteApprovalLedger.cs:95-110).TryCommitEffectAsynconly succeeds for unanimity. - 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 thatapprovedBysatisfies the policy. - Tests: 2-of-3 commits; a third approval doesn't double-commit; an unregistered challenge is denied; the same person twice is denied.
- Ledger directory hardening (Jenny J1,
SqliteApprovalLedger.cs:20-36). - Reject reparse points and junctions (
LinkTarget). - Apply the ACL and Unix mode before enumerating the directory.
- Verify the owner on Windows, then require the directory to be empty.
- Tests: a pre-existing non-empty directory is rejected; a junction is rejected.
- The visible message order can push the real target off-screen (Gronktayvius Red Team,
TwilioProvider.cs:42-46). - Order the message as Kind, Target, Ticket, command hash first, then
EffectBinding, thenLabel. - Hard-cap
EffectBindingand every target field so the prefix always fits the display limit. - Reject a
MessageCharacterLimitabove a conservative verified-viewport constant (the value needs live-doc verification). Remove the 4096 allowance. - 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.
- The ApprovalRequest constructor bypasses Create's validation (Jenny J3,
Models.cs:32,TwilioProvider.cs:42). Validaterequest/Actionfor non-null, a non-emptyJti, 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 returnInvalid, never aNullReferenceExceptionorProviderUnavailable.
Medium¶
- 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 returnsInvalid. TryRecordAsync(now)ignoresnow, so it fails open (Jenny J1,SqliteApprovalLedger.cs:82-83). Either remove it fromIApprovalClockor validate and persistnowinsideBEGIN IMMEDIATE. Test: a rolled-backnowreturns false.- Null or blank evidence becomes
ProviderUnavailableinstead ofInvalid(Jenny J2,Approvers.cs:8,36,98,102,147). Guard nulls and blank IDs. Run the bipartite match before fanning out to the provider. - Twilio time precision (Jenny J3,
Models.cs:38,TwilioProvider.cs:28,124). NormalizeCreatedUtcandExpiresUtcto whole seconds, set a minimum lifetime of about 60 s, and compare at second precision. - Outbox marker (Jenny J4,
Notifications.cs:154-158). Scope theIOException-exists catch to theCreateNewcall only. - EmailNotifier: add a log callback for the timeout, and move
SendAsyncinside the try block (Jenny J4,Notifications.cs:107,131,137). FileRequestStore:Loadhonours its nullable return, andSavewrites atomically via temp file plus move (Jenny J1).- CI: use a trx
LogFilePrefixinstead of a fixedLogFileName(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.