Under normal operation, sweepUnclaimedBonus sweeps the unreserved bonus to recoveryAddress when the pool never observed active-risk state (riskWindowStart == 0). Per DESIGN §4, the moderator may correct a mis-flag pre-claim because claimsStarted is a "value-movement finality latch" closed only by the first genuine claim.
The issue: sweep moves value out of the pool without setting claimsStarted, so a corrective re-flag from SURVIVED to CORRUPTED, goodFaith, whitehat re-snapshots snapshotTotalBonus against the drained totalBonus, computing bountyEntitlement = snapshotTotalStaked + 0 instead of the "entire pool" DESIGN §12 promises. contributeBonus is gated on outcome == UNRESOLVED, so the drained value is irrecoverable.DESIGN §4 itself defines the invariant that this code violates:
Likelihood:
The registry reaches terminal CORRUPTED without any pool interaction observing an intermediate active-risk state, leaving riskWindowStart == 0 — DESIGN §5 explicitly accepts this as the "no-risk-window CORRUPTED race."
The moderator flags SURVIVED after judging the breach out-of-scope, then determines scope was in-scope and re-flags CORRUPTED, goodFaith, whitehat — the exact sequence DESIGN §4's correction window exists to accommodate.
Any observer of the SURVIVED transaction calls the permissionless sweepUnclaimedBonus() before the corrective re-flag lands. No caller restriction; no timing gate beyond the outcome check.
Impact:
The named whitehat receives snapshotTotalStaked only, missing up to 100% of snapshotTotalBonus — the drained bonus is permanently held at recoveryAddress, violating DESIGN §12's "the entire pool is the named attacker's bounty."
The loss is irreversible: contributeBonus reverts with OutcomeAlreadySet after any flagOutcome call, so no sponsor can restore the drained bonus without a contract upgrade.
Save as test/unit/SweepFrontrunsReflagPoC.t.sol and run forge test --match-contract SweepFrontrunsReflagPoC -vv.
Withhold the "no risk observed" bonus release while claimsStarted is false, so a legitimate SURVIVED → good-faith CORRUPTED correction cannot be undermined by a pre-emptive sweep. Post-first-claim, the distribution is locked per §4 and sweep proceeds as before. The 1-wei donation grief protection at lines 503-505 is preserved because sweep still does not touch claimsStarted.
The regression test at test/unit/SweepUnclaimedBonus.t.sol:245 will need updating to assert bountyEntitlement == 150 * ONE after the corrective re-flag, reflecting the reconciled DESIGN §12 invariant.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.