It is possible for a Role.PriceFeed to both approve and disapprove the same proposal #502
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-495
edited-by-warden
🤖_11_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
sufficient quality report
This report is of sufficient quality
Lines of code
https://github.com/code-423n4/2024-05-munchables/blob/main/src/managers/LockManager.sol#L210-L242
https://github.com/code-423n4/2024-05-munchables/blob/main/src/managers/LockManager.sol#L177-L207
Vulnerability details
Impact
It is possible for a Role.PriceFeed to both approve and disapprove the same proposal unethically.
Proof of Concept
According to the contest page,
Role.PriceFeed
is not a trusted role.In the
disapproveUSDPrice
function:https://github.com/code-423n4/2024-05-munchables/blob/main/src/managers/LockManager.sol#L210-L242
Here it is observed that Role.PriceFeed is not allowed to call this function after calling the
approveUSDPrice
function due toProposalAlreadyApprovedError
revert.This eventually increases the
disapprovalsCount
.However in the
approveUSDPrice
function:https://github.com/code-423n4/2024-05-munchables/blob/main/src/managers/LockManager.sol#L177-L207
Here, it is observed that the same Role.PrceFeed can call the
approveUSDPrice
function after calling thedisapproveUSDPrice
function due to lack of validation. This eventually increases theapprovalsCount
unethically as a single Role.PriceFeed can both disapprove as well as approve a proposal.This means that a Role.PriceFeed cannot approve a proposal and then disprove the same proposal however a Role.PriceFeed can first disapprove and then approve the same proposal.
This leads to a waste of vote or favor towards a particular decision.
Tools Used
Manual Review
Recommended Mitigation Steps
Add this check in the
approveUSDPrice
function:Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: