stakingContext.auraRewardPool.withdrawAndUnwrap boolean return value not handled in Boosted3TokenPoolUtils.sol and TwoTokenPoolUtils.sol
The vault code called an external staking pool's withdraw function but ignored the boolean it returns, so a failed unstake would not be detected. An attacker could not directly exploit this, but a failed withdrawal could leave the transaction appearing to succeed while the tokens were not actually returned.
Source: https://github.com/sherlock-audit/2022-09-notional-judging/issues/118
Found by
ctf_sec
Summary
stakingContext.auraRewardPool.withdrawAndUnwrap boolean return value not handled in Boosted3TokenPoolUtils.sol and TwoTokenPoolUtils.sol
Vulnerability Detail
When calling function _unstakeAndExitPool,
the contract withdraw BPT tokens back to the vault for redemption
by calling
stakingContext.auraRewardPool.withdrawAndUnwrap(bptClaim, false);
however, the underlying call withdrawAndUnwrap returns boolean value, the contract does not handle the return value.
The see the interface of the IAuraRewardPool already indicate that the underlying call returns value
interface IAuraRewardPool {
function withdrawAndUnwrap(uint256 amount, bool claim) external returns(bool);
and the underlying call with BaseRewardConvexPool.sol also returns the boolean
function withdrawAndUnwrap(uint256 amount, bool claim) public updateReward(msg.sender) returns(bool){
Impact
Because there are stacks of external call:
Notional -> auraRewardPool -> BaseRewardPool,
without handling the return value explicitly, the transaction may risk fails silently.
Code Snippet
Tool used
Manual Review
Recommendation
We recommend the project handle the return value when unstaking explicitly
bool unstaked = stakingContext.auraRewardPool.withdrawAndUnwrap(bptClaim, false);
require(unstaked, 'unstake failed');
Discussion
jeffywu
@weitianjie2000
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 contract ignored the boolean success value returned by the external withdrawAndUnwrap call.
Impact
Because the call passes through several contracts, a failed unstake may go unnoticed and the transaction may fail silently.
What the attacker needed
Vault holds staked BPT tokens; external staking pool returns false
The fix
The project should check the returned boolean and revert if it is false.
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.
Some functions report whether they worked by returning true or false. This code called such a function but never checked the answer, so if the unstake failed the contract would carry on as if it had worked. That can leave the vault in a wrong state without anyone noticing.
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.