Closed c4-submissions closed 1 year ago
raymondfam marked the issue as sufficient quality report
raymondfam marked the issue as duplicate of #26
MiloTruck changed the severity to 3 (High Risk)
MiloTruck marked the issue as satisfactory
The warden has found the other half of the bug in #368, so I'm not giving this partial credit.
Lines of code
https://github.com/open-dollar/od-contracts/blob/v1.5.5-audit/src/contracts/AccountingEngine.sol#L199
Vulnerability details
Impact
The impact of this vulnerability is related to the validation of the surplus transfer percentage in the AccountingEngine contract. The vulnerability arises from an incorrect validation check that restricts the surplus transfer percentage to WAD ~ 1%.
Proof of Concept
The validation logic checks if the
_params.surplusTransferPercentage
exceedsWAD
(1%), causing a revert if the condition is met. According to Dev's comment regardingAccEng_surplusTransferPercentOverLimit
error, the limit ofsurplusTransferPercentage
should be100%
which is represented byONE_HUNDRED_WAD
.However, the validation incorrectly reverts when the surplus transfer percentage exceeds ONLY 1
WAD
. This leads to the unintended and excessive restriction of the protocol's ability to transfer surplus. As a result, the protocol can only transfer a maximum of 1% of the surplus to the designated receiver, with the remaining 99% sent to auction. This unnecessary validation limits the protocol's control range and affects its flexibilityTools Used
Manual Review
Recommended Mitigation Steps
Modify the validation check to compare the
_params.surplusTransferPercentage
againstONE_HUNDRED_WAD
to ensure that the percentage does not exceed the upper limit of 100%. The validation logic should be updated as follows:Assessed type
Invalid Validation