Skip to content

FLT-359 fix round 4 (Cedric): re-gate findings

The findings are in docs/review-r5/. Andrew chose to fix these before landing (2026-10-31).

Constraints, same as before: - Approvals stay disabled by default. - No network, no secrets, no fleet wiring. - Clahadore commits. Don't push. - Write a red test first for every bug. If a test genuinely can't run on this OS, say so plainly.

High

  1. Ledger path swap / ancestor junction (Gronktayvius Red Team, SqliteApprovalLedger.cs:30,49).
  2. Reject reparse points and symlinks on every path component from the volume root, not only the leaf.
  3. Open the parent with no-follow semantics:
    • Windows: FILE_FLAG_OPEN_REPARSE_POINT, and refuse any reparse tag.
    • Unix: O_NOFOLLOW | O_DIRECTORY.
  4. Create and open the database relative to that verified handle where .NET allows it. Otherwise re-verify identity after opening.
  5. Persist the file identity (Windows file ID plus volume serial; Unix device plus inode), the owner and the mode. Every later Open refuses the file if any of them differ.
  6. Tests: a junction in an ancestor folder is rejected; swapping the database file between opens is detected (identity mismatch), and fails closed.
  7. Initialize must not modify an existing directory (Gronktayvius General, SqliteApprovalLedger.cs:40-45).
  8. Check all preconditions first: no reparse point anywhere, owner OK, and empty, before any ACL or mode change.
  9. Create a brand-new directory with its security descriptor in the same create call (DirectorySecurity overload / CreateDirectory with ACL; mkdir mode 0700).
  10. If a re-check after locking finds entries, fail without having altered a pre-existing folder.
  11. Test: pointing it at an existing non-empty directory leaves that directory's ACL and mode unchanged and throws.
  12. Outbox marker atomic publish (Gronktayvius General, Notifications.cs:167-170).
  13. Write a temp file, fsync it, then do an atomic rename onto the marker path (no overwrite).
  14. On a write, flush or rename failure, delete the temp file and don't treat the notification as sent.
  15. Only a renamed marker counts as "already notified".
  16. Test: an injected write failure followed by a retry sends the notification.

P2 and Medium

  1. The size limit must survive a round trip (Cedric, Models.cs:118-119). Apply the byte limit to the canonical serialized form at initial validation, so anything Parse accepts also passes Parse(Serialize(x)). Test: Cedric's reproduction (64-char < labels, 4 target fields, 8 recipients) is rejected up front, and a just-under-limit action round-trips.
  2. Sanitize the push text (Gronktayvius Red Team + General, TwilioProvider.cs:45, Models.cs:103). Replace control characters, bidi overrides (U+202A–U+202E, U+2066–U+2069), zero-width characters, U+2028/2029 and newlines in EffectBinding/HumanSummary before building the device message. The hash still covers the original canonical action. Test: a bidi-override and newline-injected fake Target: line can't appear as its own line in the device text.
  3. Any other Medium in docs/review-r5/*.md you agree with. Respond to each item in docs/review-r5/RESPONSES.md.

Verify

  • dotnet build --no-restore -warnaserror and dotnet test --no-restore. Use -p:OutputPath=bin/R6/ if locked.
  • In the final message: the red-first bugs, the changes, the real output tails, and anything that can't be tested on Windows (e.g. the Unix no-follow path).