FoundrySolidityLayer 2
7.25 ETH
Submission Details
Impact: high
Likelihood: high

Risk Observation Is Rolled Back When Withdrawal Reverts, Allowing Withdrawals After Risk Has Been Observed

Author Revealed upon completion

DESCRIPTION

The contract intends riskWindowStart to be a one-way lock. Once the registry is observed in an active-risk state, withdrawals should stay disabled forever.
The issue is that withdraw() calls _observePoolState() first, which may set riskWindowStart, but then withdraw() reverts if withdrawals are disabled.
Because the whole transaction reverts, the riskWindowStart update is rolled back too.

SCENARIO

  1. Alice stakes.

  2. Registry moves to UNDER_ATTACK

  3. Alice calls withdraw().

  4. _observePoolState() sees UNDER_ATTACK and tries to set riskWindowStart

  5. withdraw() then reverts with WithdrawsDisabled.

  6. Because the transaction reverted, riskWindowStart remains 0.

  7. Should the registry later rewound to a pre-risk state before any successful pokeRiskWindow() call, withdrawal will become possible again.

RECOMMENDED MITIGATION/FIX

Their should be an atomic call to pokeRiskWindow() when the registry enters active risk state.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!