51320 sc low malicious teller parameter allow event data manipulation
Description
Brief / Intro
Vulnerability Details
function depositAndBridge(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint,
BridgeData calldata data,
@> CrossChainTellerBase teller, // @audit user-controlled
PredicateMessage calldata predicateMessage
)
external
payable
nonReentrant
{
...
}
lastSender = msg.sender;
@> ERC20 vault = ERC20(teller.vault());
//approve vault to take assets from proxy
@> depositAsset.safeApprove(address(vault), depositAmount);
//transfer deposit assets from sender to this contract
depositAsset.safeTransferFrom(msg.sender, address(this), depositAmount);
// mint shares
@> teller.depositAndBridge{ value: msg.value }(depositAsset, depositAmount, minimumMint, data);
lastSender = address(0);
@> uint96 nonce = teller.depositNonce();
//get the current share lock period
uint64 currentShareLockPeriod = teller.shareLockPeriod();
@> AccountantWithRateProviders accountant = AccountantWithRateProviders(teller.accountant());
//get the share amount
@> uint256 shares = depositAmount.mulDivDown(10 ** vault.decimals(), accountant.getRateInQuoteSafe(depositAsset));
// @audit - event data can be manipulated
emit Deposit(
address(teller),
data.destinationChainReceiver,
address(depositAsset),
depositAmount,
shares,
block.timestamp,
currentShareLockPeriod,
nonce > 0 ? nonce - 1 : 0,
address(vault)
);
}Recommendation
Proof of Concept
Previous50783 sc low validator percentage cap does not work properlyNext51966 sc low totalamountclaimable reverts instead of returning the claimable reward for historical tokens
Was this helpful?