Contracts allow sending ETH on calls which does not expect it #71
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
Handle
TomFrenchBlockchain
Vulnerability details
Impact
Detailed description of the impact of this finding.
Proof of Concept
Take for example the
depositCollateral
function. It's payable but the pool may not use ETH as collateralhttps://github.com/code-423n4/2021-12-sublime/blob/9df1b7c4247f8631647c7627a8da9bdc16db8b11/contracts/Pool/Pool.sol#L175-L179
In the case where the user is performing a direct deposit then we'll pull in the erc20 collateral asset using the
transferTokens
function however there's no check formsg.value == 0
when transferring an ERC20 asset.https://github.com/code-423n4/2021-12-sublime/blob/9df1b7c4247f8631647c7627a8da9bdc16db8b11/contracts/SavingsAccount/SavingsAccountUtil.sol#L98-L127
Similarly when depositing ETH from a savings account any ETH in
msg.value
will be lost.Recommended Mitigation Steps
Add a check that msg.value is zero on all code paths which do not handle ETH.
Consider whether to simplify to just use WETH.
The text was updated successfully, but these errors were encountered: