An oracle can approve an USD price even if it has disapproved the price already.
Proof of Concept
When an oracle approves an USD price, function approveUSDPrice only check if the oracle has approved the price already, and reverts the tx if it has. But the function does not check if the oracle has disapproved the price already. As a result, the oracle can first disapprove the price, and then approve the price again. This may mess up the pricing of tokens.
Lines of code
https://github.com/code-423n4/2024-05-munchables/blob/main/src/managers/LockManager.sol#L177-L200
Vulnerability details
Impact
An oracle can approve an USD price even if it has disapproved the price already.
Proof of Concept
When an oracle approves an USD price, function
approveUSDPrice
only check if the oracle has approved the price already, and reverts the tx if it has. But the function does not check if the oracle has disapproved the price already. As a result, the oracle can first disapprove the price, and then approve the price again. This may mess up the pricing of tokens.https://github.com/code-423n4/2024-05-munchables/blob/main/src/managers/LockManager.sol#L177-L200
Tools Used
VS Code
Recommended Mitigation Steps
In function
approveUSDPrice
, check if the oracle has disapproved the USD price, and revert the tx if it has.Assessed type
Other