51746 sc low depositandbridge function of tellerwithmultiassetsupportpredicateproxy sol can not be paused
Description
Brief / Intro
Vulnerability Details
File: TellerWithMultiAssetSupportPredicateProxy.sol
function depositAndBridge(
ERC20 depositAsset,
uint256 depositAmount,
uint256 minimumMint,
BridgeData calldata data,//msgGas not validated with msg.value.
CrossChainTellerBase teller,
PredicateMessage calldata predicateMessage
)
external
payable
nonReentrant
{
if (paused()) {//@audit pause is checked but pause() function not implemented
revert TellerWithMultiAssetSupportPredicateProxy__Paused();
}
//@dev This is NOT the actual function that is called, it is the against which the predicate is authorized
bytes memory encodedSigAndArgs = abi.encodeWithSignature("depositAndBridge()");
//still use 0 for msg.value since we only need validation against sender address
if (!_authorizeTransaction(predicateMessage, encodedSigAndArgs, msg.sender, 0)) {
revert TellerWithMultiAssetSupportPredicateProxy__PredicateUnauthorizedTransaction();
}
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));
emit Deposit(
address(teller),
data.destinationChainReceiver,
address(depositAsset),
depositAmount,
shares,
block.timestamp,
currentShareLockPeriod,
nonce > 0 ? nonce - 1 : 0,
address(vault)
);
}Impact Details
Recommendation
Proof of Concept
1
2
3
Previous52241 sc low unexposed pauseable functionalityNext51988 sc medium plumerewardlogic calculaterewardswithcheckpointsview lacking of checking if the validator is inactive but not slashed
Was this helpful?