deposit in ConvexStakingWrapper will most certainly revert
The deposit function in ConvexStakingWrapper calls poolInfo on a BaseRewardPool contract that does not implement that function, causing every deposit to revert. An attacker cannot exploit this for gain, but the core staking functionality is broken.
Submitted by wuwe1, also found by WatchPug
ConvexStakingWrapper.sol#L94-L99
address mainPool = IRewardStaking(convexBooster)
.poolInfo(_pid)
.crvRewards;
if (rewards[_pid].length == 0) {
pids[IRewardStaking(convexBooster).poolInfo(_pid).lptoken] = _pid;
convexPool[_pid] = mainPool;
convexPool[_pid] is set to IRewardStaking(convexBooster).poolInfo(_pid).crvRewards;
crvRewards is a BaseRewardPool like this one: https://etherscan.io/address/0x8B55351ea358e5Eda371575B031ee24F462d503e#code.
BaseRewardPool does not implement poolInfo
IRewardStaking(convexPool[_pid]).poolInfo(_pid).lptoken
Above line calls poolInfo of crvRewards which causes revert.
Recommended Mitigation Steps
According to Booster’s code
https://etherscan.io/address/0xF403C135812408BFbE8713b5A23a04b3D48AAE31#code
//deposit lp tokens and stake
function deposit(uint256 _pid, uint256 _amount, bool _stake) public returns(bool){
require(!isShutdown,"shutdown");
PoolInfo storage pool = poolInfo[_pid];
require(pool.shutdown == false, "pool is closed");
//send to proxy to stake
address lptoken = pool.lptoken;
IERC20(lptoken).safeTransferFrom(msg.sender, staker, _amount);
convexBooster requires poolInfo[_pid].lptoken.
change L238 to
IRewardStaking(convexBooster).poolInfo(_pid).lptoken
Alex the Entreprenerd (judge) commented:
The warden has shown how an improper assumption about the pool contract can cause reverts.
While the risk of loss of funds is non-existent because all calls will revert, I believe the core functionality of the code is broken. For that reason, I think High Severity to be the proper severity.
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
The code assumes that the crvRewards contract (a BaseRewardPool) implements poolInfo, but it does not, so the call reverts.
Impact
All deposit attempts revert, breaking the core staking functionality, though no funds are lost.
What the attacker needed
None
The fix
The code should call poolInfo on convexBooster instead of on convexPool[_pid].
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.
This is a smart contract bug where a function tries to call a method on the wrong contract. The contract it calls does not have that method, so the transaction fails and any deposit attempt reverts. This means users cannot stake their tokens through this wrapper.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.