Ensure zero msg.value if transferring from user and baseAsset is not WETH. #114
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate
This issue or pull request already exists
Lines of code
https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L338
https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L360
https://github.com/code-423n4/2022-06-putty/blob/3b6b844bc39e897bd0bbb69897f2deff12dc3893/contracts/src/PuttyV2.sol#L436
Vulnerability details
Impact
Ensure zero msg.value if transferring from user and baseAsset is not WETH.
A user that mistakenly calls either fillOrder() or exercise() with native ETH when baseAsset is not WETH, his native ETH will be locked in the contract.
Proof of Concept
There is a reference of the same issue.
Tools Used
Solidity Visual Developer of VSCode
Recommended Mitigation Steps
We should ensure msg.value == 0 for above cases.
The text was updated successfully, but these errors were encountered: