0xe4669da - DefaultBondStrategy::_deposit()
could fail silently hence no tokens will be minted for Vault
because return value of Vault::delegateCall
is unchecked in DefaultBondStrategy::_deposit
#296
Labels
Excluded
Excluded by the judge without consulting the protocol or the senior
Non-Reward
This issue will not receive a payout
Sponsor Disputed
The sponsor disputed this issue's validity
0xe4669da
Medium
DefaultBondStrategy::_deposit()
could fail silently hence no tokens will be minted forVault
because return value ofVault::delegateCall
is unchecked inDefaultBondStrategy::_deposit
Summary
Bond
is an external smart contract andBond::deposit
function call could fail.DefaultBondStrategy::_deposit
function call totally depends on external callBond::deposit
.Vulnerability Detail
DefaultBondStrategy::_deposit
is usingVault::delegateCall
function, ifBond::deposit
fails, it will fail silently. No tokens will be minted forVault
because the return value ofVault::delegateCall
is unchecked inDefaultBondStrategy
.Scenario and transaction flow
VaultConfigurator::depositCallback
is set toDefaultBondstrategy
Vault::deposit
function is called by depositorDefaultBondStrategy::depositCallback
is calledDefaultBondStrategy::_deposit
is calledVault::delegateCall
is called return value is uncheckedVault
givesdelegatecall
toDefaultBondModule
DefaultBondModule
callsBond::deposit
assuming failure of this functionSource
Code:
Impact
No assets will be transferred to
Bond
smart contract. No bond tokens will be minted forVault
and failure will go unnoticed. This results into breakage of core functionality of mellow protocol.Code Snippet
forge test --mt test_wy_DepositCallbackWithBonds --fork-url https://eth-mainnet.g.alchemy.com/v2/[api0-key]
Simply
revert
inDefaultBondMock.sol
Add below test in
DefaultBondStrategyTest.t.sol
Code
Tool used
Manual Review
Recommendation
In
DefaultBondStrategy::_deposit
check the return value ofVault::delegateCall
function call because it returnsbool success
, ifsuccess == false
thenrevert
The text was updated successfully, but these errors were encountered: