stake() lets the sponsor lock first-staker funds until 2106The one-way expiryLocked latch is intended to preserve the deadline a staker relied on when depositing. Once the first stake succeeds, the sponsor can no longer move that deadline.
However, stake() accepts only an amount and locks whichever expiry is stored at execution time. A sponsor can front-run the pending first stake with setExpiry(type(uint32).max). When the agreement is already UNDER_ATTACK, the victim's stake still succeeds but withdrawal becomes immediately unavailable, leaving the expiry backstop inaccessible until February 2106.
Likelihood:
Occurs on the first stake while the sponsor still controls expiry and the agreement is already UNDER_ATTACK.
Requires the sponsor to observe and order setExpiry() before the victim's pending stake.
Impact:
The victim's deposited principal becomes non-withdrawable immediately after execution.
The expiry backstop can be delayed to the uint32 ceiling, locking funds for decades while the registry remains nonterminal.
Setup: append the function below to test/unit/ConfidencePool.t.sol (same ConfidencePoolTest harness / BaseConfidencePoolTest helpers already used by the suite), then run:
The registry is set to UNDER_ATTACK so any successful first stake will disable withdrawals.
Before alice's stake lands, the sponsor calls setExpiry(type(uint32).max).
Alice's first stake executes successfully and latches expiryLocked on that rewritten deadline.
Alice's withdraw() reverts with WithdrawsDisabled.
After warping one year forward, claimExpired() still reverts with PoolNotExpired, so the expiry backstop is unavailable for decades while the registry remains nonterminal.
Require the staker to commit to the expected expiry, and optionally a transaction deadline or full configuration hash.
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.