code-423n4 / 2021-12-amun-findings

0 stars 0 forks source link

Restrict funds receivable to be only from wrapped native token #122

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

defsec

Vulnerability details

Impact

Native fund transfers into the basket contracts are only expected from the wrapped token contract. Hence, it would be good to restrict incoming fund transfers to prevent accidental native fund transfers from other sources.

Proof of Concept

  1. Navigate to the following contract code.
https://github.com/code-423n4/2021-12-amun/blob/cf890dedf2e43ec787e8e5df65726316fda134a1/contracts/basket/contracts/singleJoinExit/SingleTokenJoinV2.sol#L19
  1. On the all basket contracts, The following comment has been written.
    // WETH or WAVAX ...
    IERC20 public immutable INTERMEDIATE_TOKEN;

Tools Used

None

Recommended Mitigation Steps

receive() external payable {
require(msg.sender == address(WETH) | msg.sender == address(WAVAX), 'only wrapped eth');
}
0xleastwood commented 2 years ago

Duplicate of #253