Skip to content

test: add adversarial Root race fuzzer - #748

Merged
steipete merged 5 commits into
mainfrom
codex/hunt-root-races-20260927
Sep 28, 2026
Merged

steipete merged 5 commits into
mainfrom
codex/hunt-root-races-20260927

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Add a reusable adversarial Root race harness with separate attacker processes, exact sentinel identity/content snapshots, per-operation effect counts, configurable seeds and attacker shapes, and quiet/oracle controls. It covers parent aliases, retargeting, directory replacement, hardlinks, type flips, and Root-ancestor swaps. appendCreate uses a unique seed/call basename for every attempt so a success cannot merely reopen an existing file; attackers reclaim these names only inside their restored real directories.

Strict runs fail on observed effects or incomplete coverage. Every selected operation must succeed within each seed, helper-unavailable responses remain incomplete even when mixed with other outcomes, copy results must actually be inspected, and attacker batches must overlap the victim interval. Worker start/shutdown handshakes prevent idle or unjoined attackers from producing a clean verdict.

The optional dwell-scale multiplier varies both hostile-state and restored-directory intervals. Default 1 preserves the original 0–0.4 ms timing; scale 20 explores 0–8 ms intervals to exercise longer guarded paths as well as immediate rejection. The scale is recorded, and the strict gates are unchanged. Incomplete fast-loop campaigns remain incomplete and are retained separately.

The original c1529cb harness commit is preserved. Follow-ups address coverage, oracle integrity, worker shutdown, timing variation, and building the matching Windows native binding. Quiet and deliberate-effect oracle controls and independent Codex review through P2 passed. This harness is independently useful and does not certify every schedule or every filesystem boundary.

Current-head CI is green: 38 passing checks, seven skips. The final harness produced complete 60 x 20-second strict campaigns for the combined hardening candidate on Linux openat2/forced fallback and macOS/Windows. Unsupported recursive-directory capability is separately verified fail-closed; it is never counted as successful recursive coverage.

@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 9:28 AM ET / 13:28 UTC (Revision 8).

ClawSweeper review

What this changes

Adds a standalone filesystem race harness that drives guarded Root operations against concurrent attacker processes and records sentinel effects and coverage for each seed.

Merge readiness

⛔ Blocked before merge - 6 items remain

Keep this PR open. The adversarial Root race harness is absent from current main and v0.21.1, and its cross-platform campaign evidence supports a distinct contribution. Two previously identified, actionable blockers remain.

Priority: P2
Reviewed head: ac814c2b532bb0f19ff1cdad28dee9cb65a88873

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Cross-platform campaign evidence is strong, but two concrete script defects keep the patch from being merge-ready.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The changed owner is the standalone Root race runner. Linked Linux, macOS, and Windows workflow jobs exercised matching runner and attacker blobs against built native Root operations; their campaign step passed strict assertions for zero effects and complete seeds. Raw receipts were unavailable to this reviewer because the job-log host was blocked. No stored-data contract changes.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The changed owner is the standalone Root race runner. Linked Linux, macOS, and Windows workflow jobs exercised matching runner and attacker blobs against built native Root operations; their campaign step passed strict assertions for zero effects and complete seeds. Raw receipts were unavailable to this reviewer because the job-log host was blocked. No stored-data contract changes.
Evidence reviewed 9 items Introduced harness: The pinned main-to-head diff adds seven root-race files and no package runtime changes.
Unverified installer execution: The optional Linux campaign downloads the current Rustup installer and executes it without a fixed version or digest.
Native-off campaign selection: The Linux campaign starts a strict native-off run without selecting an operation subset, so the runner uses every method.
Findings 2 actionable findings [P2] Pin or verify the Rustup installer before executing it
[P2] Exclude native-only operations from the native-off strict lane
Security Needs attention Unverified remote installer execution: The script runs a freshly downloaded installer without a fixed version or digest; a changed upstream installer would execute on a proof machine outside the reviewed source.

How this fits together

Root is the package's guarded filesystem interface for paths supplied by applications. This harness sends Root operations through changing filesystem aliases and records whether effects escape the intended boundary or coverage remains incomplete.

flowchart LR
  A[Operations and seeds] --> B[Race harness]
  C[Attacker processes] --> D[Changing filesystem aliases]
  B --> E[Guarded Root operations]
  D --> E
  E --> F[Sentinel snapshots]
  F --> G[Strict campaign verdict]
Loading

Before merge

  • Pin or verify the Rustup installer before executing it (P2) - When Rustup is absent, this script downloads the current installer and runs it without a fixed digest. A proof machine then executes code outside the reviewed revision before generating security evidence; require a provisioned toolchain or verify a pinned installer.
  • Exclude native-only operations from the native-off strict lane (P2) - This lane does not pass --ops, so it selects every runner method, including no-clobber move and bounded temp cleanup. Current main rejects those operations without native support, and the runner marks any such response incomplete, preventing a clean strict result.
  • Resolve security concern: Unverified remote installer execution - The script runs a freshly downloaded installer without a fixed version or digest; a changed upstream installer would execute on a proof machine outside the reviewed source.
  • Resolve merge risk (P1) - On a Linux machine without Rustup, the optional campaign executes a mutable remote installer before producing security evidence.
  • Resolve merge risk (P1) - The native-off strict lane selects native-only operations, making its clean coverage verdict unattainable even when supported operations behave correctly.
  • Complete next step (P2) - Use a trusted Linux toolchain and make the native-off strict campaign select only supported operations before merge.

Findings

  • [P2] Pin or verify the Rustup installer before executing it — scripts/root-race/linux-campaign.sh:7-8
  • [P2] Exclude native-only operations from the native-off strict lane — scripts/root-race/campaign.mjs:7
  • [medium] Unverified remote installer execution — scripts/root-race/linux-campaign.sh:7
Agent review details

Security

Needs attention: The optional Linux campaign executes an unpinned Rustup installer before generating security proof.

Review metrics

Metric Value Why it matters
LOC delta production +0; harness scripts +526; harness docs +62 The substantial addition is security test infrastructure, with no package runtime change.

Merge-risk options

Maintainer options:

  1. Repair both campaign paths (recommended)
    Require a trusted Linux toolchain and select only supported operations for the native-off strict lane, while retaining explicit unsupported-capability checks.
  2. Pause the campaign scripts
    Keep the reusable runner under review while deferring the bootstrap and multi-backend campaign scripts until their setup and verdict contracts are safe.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Remove unverified Rustup installer execution from linux-campaign.sh by requiring a provisioned toolchain or a version-pinned installer with a fixed digest; select native-off-compatible strict operations in campaign.mjs and verify that native-only operations remain separately fail-closed.

Technical review

Best possible solution:

Keep the harness, use a provisioned or version-pinned and verified Linux toolchain, and give each backend a supported strict operation list with separate fail-closed checks for unavailable capabilities.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: the native-off campaign selects no-clobber move although current main requires a native binding, and the Linux script explicitly executes the downloaded installer. The read-only review did not run either script.

Is this the best way to solve the issue?

No. The adversarial harness is useful, but its setup must use a trusted toolchain and strict operation selection must reflect backend capabilities.

Full review comments:

  • [P2] Pin or verify the Rustup installer before executing it — scripts/root-race/linux-campaign.sh:7-8
    When Rustup is absent, this script downloads the current installer and runs it without a fixed digest. A proof machine then executes code outside the reviewed revision before generating security evidence; require a provisioned toolchain or verify a pinned installer.
    Confidence: 0.98
  • [P2] Exclude native-only operations from the native-off strict lane — scripts/root-race/campaign.mjs:7
    This lane does not pass --ops, so it selects every runner method, including no-clobber move and bounded temp cleanup. Current main rejects those operations without native support, and the runner marks any such response incomplete, preventing a clean strict result.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 6a22d19228d7.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is useful, bounded security validation work with two normal-priority merge blockers.
  • merge-risk: 🚨 security-boundary: The optional Linux proof path executes an installer that is not pinned or independently verified.
  • merge-risk: 🚨 automation: The native-off campaign's default operation list can make a strict campaign fail for unsupported capabilities.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (linked_artifact): The changed owner is the standalone Root race runner. Linked Linux, macOS, and Windows workflow jobs exercised matching runner and attacker blobs against built native Root operations; their campaign step passed strict assertions for zero effects and complete seeds. Raw receipts were unavailable to this reviewer because the job-log host was blocked. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed owner is the standalone Root race runner. Linked Linux, macOS, and Windows workflow jobs exercised matching runner and attacker blobs against built native Root operations; their campaign step passed strict assertions for zero effects and complete seeds. Raw receipts were unavailable to this reviewer because the job-log host was blocked. No stored-data contract changes.

Evidence

Security concerns:

  • [medium] Unverified remote installer execution — scripts/root-race/linux-campaign.sh:7
    The script runs a freshly downloaded installer without a fixed version or digest; a changed upstream installer would execute on a proof machine outside the reviewed source.
    Confidence: 0.98

Acceptance criteria:

  • [P1] pnpm check.
  • [P1] git diff --check.
  • [P1] node scripts/root-race/campaign.mjs.

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Use a provisioned or pinned-and-verified Rustup installer for Linux proof.
  • Select strict operations supported by each backend, including native-off mode.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (7 earlier review cycles)
  • reviewed 2026-09-28T05:46:32.287Z sha 20cb65c :: blocked before merge. :: [P2] Use a matching native binding for Windows race runs
  • reviewed 2026-09-28T06:30:31.360Z sha 20b4713 :: blocked before merge. :: none
  • reviewed 2026-09-28T08:09:46.071Z sha 20b4713 :: blocked before merge. :: [P2] Pin or verify the Rustup installer before executing it
  • reviewed 2026-09-28T08:13:29.398Z sha 20b4713 :: blocked before merge. :: [P2] Pin or verify the Rustup installer before executing it
  • reviewed 2026-09-28T11:09:33.678Z sha a4ccbbf :: blocked before merge. :: [P2] Pin or verify the Rustup installer before executing it | [P2] Exclude unsupported operations from native-off strict runs
  • reviewed 2026-09-28T12:23:20.827Z sha c6b4737 :: blocked before merge. :: [P2] Pin or verify the Rustup installer before executing it | [P2] Exclude native-only operations from the native-off strict lane
  • reviewed 2026-09-28T13:14:31.387Z sha c6b4737 :: blocked before merge. :: [P2] Pin or verify the Rustup installer before executing it | [P2] Exclude native-only operations from the native-off strict lane

@steipete
steipete marked this pull request as ready for review September 28, 2026 08:10
@steipete
steipete requested a review from a team as a code owner September 28, 2026 08:10
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. proof: sufficient Contributor real behavior proof is sufficient. labels Sep 28, 2026
@steipete
steipete force-pushed the codex/hunt-root-races-20260927 branch from c6b4737 to ac814c2 Compare September 28, 2026 13:23
@steipete
steipete merged commit cf71fe8 into main Sep 28, 2026
46 checks passed
@steipete
steipete deleted the codex/hunt-root-races-20260927 branch September 28, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant