Open code423n4 opened 2 years ago
This technically is true, but I consider this informational as this is an extreme edge case. The poolDelegate and mapleTreasury values are almost guaranteed to never change, and if they did it would be to an audited Maple implementation which would never use bytes memory to return the address.
This is a cool finding and we will address, but it is informational.
Disagree with sponsor on the rating. This has external requirements and assets are not at direct risk, but it qould result in a loss of funds.
Lines of code
https://github.com/maple-labs/loan/blob/main/contracts/MapleLoanInternals.sol#L332-L344
Vulnerability details
Impact
MapleLoanInternals._sendFee should check returnData.length == 32 before decoding, otherwise if it returns bytes data, the abi.decode will return 0x20, result in lost tokens.
Proof of Concept
https://github.com/maple-labs/loan/blob/main/contracts/MapleLoanInternals.sol#L332-L344 This contract can test that when the function returns bytes data, abi.encode will decode the return value as 0x20.
Tools Used
None
Recommended Mitigation Steps