Open code423n4 opened 1 year ago
0xSorryNotSorry marked the issue as primary issue
not a real issue
ElliotFriedman marked the issue as sponsor disputed
Valid as QA, should be added to the governance guidelines on which tokens are not compatible with the protocol.
alcueca changed the severity to QA (Quality Assurance)
alcueca marked the issue as grade-a
Lines of code
https://github.com/code-423n4/2023-07-moonwell/blob/fced18035107a345c31c9a9497d0da09105df4df/src/core/MToken.sol#L159
Vulnerability details
Impact
The approve function overrides the ERC20 function and allows a user to approve someone else to spend tokens on their behalf. However, there are some tokens (LEND) that will revert if the allowance isn't set to zero before changing the allowance. Consider setting allowance to zero first as this is safer against front-running attacks and will also allow for tokens that need approve(0) to be set first.
Proof of Concept
Tools Used
Manual review.
Recommended Mitigation Steps
Assessed type
Token-Transfer