Attacker can grift syndicate staking by staking a small amount
The liquid staking manager always stakes a fixed 12 ETH through the syndicate, but the syndicate contract caps total staking at 12 ETH and reverts on overflow. An attacker who owns a small amount of the staking token can front-run a mintDerivatives call by staking a tiny amount, causing the legitimate 12 ETH stake to revert.
Submitted by Lambda
https://github.com/code-423n4/2022-11-stakehouse/blob/a0558ed7b12e1ace1fe5c07970c7fc07eb00eebd/contracts/liquid-staking/LiquidStakingManager.sol#L882 https://github.com/code-423n4/2022-11-stakehouse/blob/23c3cf65975cada7fd2255a141b359a6b31c2f9c/contracts/syndicate/Syndicate.sol#L22
LiquidStakingManager._autoStakeWithSyndicate always stakes a fixed amount of 12 ETH. However, Syndicate.stake only allows a total staking amount of 12 ETH and reverts otherwise:
if (_sETHAmount + totalStaked > 12 ether) revert InvalidStakeAmount();
An attacker can abuse this and front-run calls to mintDerivatives (which call _autoStakeWithSyndicate internally). Because Syndicate.stake can be called by everyone, he can stake the minimum amount (1 gwei) such that the mintDerivatives call fails.
Proof Of Concept
As soon as there is a mintDerivatives call in the mempool, an attacker (that owns sETH) calls Syndicate.stake with an amount of 1 gwei. _autoStakeWithSyndicate will still call Syndicate.stake with 12 ether. However, _sETHAmount + totalStaked > 12 ether will then be true, meaning that the call will revert.
Recommended Mitigation Steps
Only allow staking through the LiquidStakingManager, i.e. add access control to Syndicate.stake.
vince0656 (Stakehouse) confirmed
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the syndicate's stake function has no access control and enforces a hard cap that the manager's fixed 12 ETH stake can exceed when any other stake exists.
Impact
Legitimate mintDerivatives transactions could be made to fail, disrupting the staking flow for other users.
What the attacker needed
Attacker owns a small amount of sETH; ability to front-run a pending transaction
The fix
Access control should be added so that only the LiquidStakingManager can call Syndicate.stake.
How it was found
- Watch the mempool for a mintDerivatives call.
- Call Syndicate.stake with a tiny amount of sETH before that transaction is mined.
- The mintDerivatives call then attempts to stake 12 ETH and reverts because the total would exceed the cap.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A smart contract lets users pool money for staking. One function always tries to add exactly 12 ETH, but the pool refuses any total above 12 ETH. Because anyone can add to the pool, an attacker can add a tiny amount first so the legitimate 12 ETH addition no longer fits and fails.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.