Low Tangerine Cod
High
There is no validation for signature that user uses on withdraw for index
, and msg.sender
In withdraw function signature and odos data passed to cds contract
function withDraw(
address toAddress,
uint64 index,
bytes memory odosAssembledData,
bytes memory signature
) external payable nonReentrant whenNotPaused(IMultiSign.Functions(1)) {
// check is _toAddress in not a zero address and isContract address
if (toAddress == address(0) || isContract(toAddress)) revert Borrow_CantBeContractOrZeroAddress(toAddress);
--> if (!cds.verify(odosAssembledData, signature)) revert Borrow_NotSignedByEIP712Signer();
// Get the depositor details
Blockchian/contracts/Core_logic/borrowing.sol#L290
E.x. there are two positions. E.x.there is upside - 1 wrsETH after first withdraw and 2 wrsEth after second withdraw. Target for odos swap is TREASURY from tests. Everything goes normal user uses 1 signature for first withdrawal - 1 wrsETH exchange for 1000 udst to treasury Everything goes normal user uses second signature for second withdrawal - 2 wrsETH exchange for 2000 udst to treasury
Attacker uses first signature for second withdrawal 1 wrsETH exchange for 1000 udst, but upside left - 2 wrsETH - 1 wrsETH=1wrsETH
left unaccounting. Which means some holders will not receive their stake which leads to depeging as the point of protocol to catch upside and distribute correctly
No response
none
use odos data from 1 withdrawal and use it on another withdrawal
holders will not receive their stake which leads to depeging as the point of protocol to catch upside and distribute correctly
index, should be included in signature validation and msg.sender so other users could not use it
function withDraw(
address toAddress,
uint64 index,
bytes memory odosAssembledData,
bytes memory signature
) external payable nonReentrant whenNotPaused(IMultiSign.Functions(1)) {
// check is _toAddress in not a zero address and isContract address
if (toAddress == address(0) || isContract(toAddress)) revert Borrow_CantBeContractOrZeroAddress(toAddress);
- if (!cds.verify(odosAssembledData, signature)) revert Borrow_NotSignedByEIP712Signer();
+ if (!cds.verify(odosAssembledData, signature, index, msg.sender)) revert Borrow_NotSignedByEIP712Signer();