The attacker can use the USDOMarketModule.sendAndLendOrRepay function to call _debitFrom, which can be used to cheat victims.
Proof of Concept
_debitFrom is an internal function, but can be by USDOMarketModule.sendAndLendOrRepay or other functions to call,
sendAndLendOrRepay first calls _debitFrom and then _lzSend. _lzSend can pass any lzDstChainId and address parameters, regardless of the result of _lzSend. It only needs to make sure that the transaction is not rolling back,
this is equivalent to calling the internal function _debitFromdirectly.
Lines of code
https://github.com/Tapioca-DAO/tapioca-bar-audit/blob/2286f80f928f41c8bc189d0657d74ba83286c668/contracts/usd0/modules/USDOMarketModule.sol#L60
Vulnerability details
Impact
The attacker can use the
USDOMarketModule.sendAndLendOrRepay
function to call_debitFrom
, which can be used to cheat victims.Proof of Concept
_debitFrom
is an internal function, but can be byUSDOMarketModule.sendAndLendOrRepay
or other functions to call,sendAndLendOrRepay
first calls_debitFrom
and then_lzSend
._lzSend
can pass anylzDstChainId
andaddress
parameters, regardless of the result of _lzSend. It only needs to make sure that the transaction is not rolling back, this is equivalent to calling the internal function_debitFrom
directly.Tools Used
vscode
Recommended Mitigation Steps
hash checks incoming and outgoing parameters during cross-chain calls to add a feedback mechanism for
_lzSend
.Assessed type
Other