code-423n4 / 2022-01-openleverage-findings

0 stars 0 forks source link

Unchecked returns #192

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

0x1f8b

Vulnerability details

Impact

Unchecked returns.

Proof of Concept

In OpenLevV1 contract, the method call 97,57: (ControllerInterface(addressConfig.controller)).marginTradeAllowed(marketId); without check the returned value. Because ControllerV1.marginTradeAllowed never return false it's recommended to remove the boolean return, otherwise, it must be checked because other contract can implement a different logic in the future.

Also there are a lack of SafeERC20 calls in the following calls:

ERC20 standard specify that the token can return false if the approve, transfer or transferFrom was not made, so it's mandatory to check the result of this calls.

Tools Used

Manual review.

Recommended Mitigation Steps

Check the returned values.

0xleastwood commented 2 years ago

Duplicate of #17