M-04 MitigationConfirmed #99
Labels
confirmed for report
This issue is confirmed for report
mitigation-confirmed
MR-M-04
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
Vulnerability details
C4 Issue
M-04: Function Pool.validateOffer() does not work correctly in case principalAmount > currentBalance
Comments
Original vulnerabilities/impacts:
In Pool::validateOffer, check is in place to see of the pool has enough funds to lend, when the required loan principal amount is greater than the pool’s current balance, reallocate() is invoked to transfer the delta amount to the pool.
The problem is the input argument(
principalAmount - currentBalance
) in reallocate() is incorrect, which will result in funds being transferred out of the pool instead.Mitigation
Fix: https://github.com/pixeldaogg/florida-contracts/pull/365/files
The correct parameter input should be
reallocate(currentBalance, principalAmount, true)
. As in reallocate, currentBalance (_currentIdle
) and principalAmount(_targetIdle
) will be compared and their delta is the transfer amount. This is consistent with the mitigation.The mitigation corrects the mistake and resolves the issue.
Conclusion
LGTM
The text was updated successfully, but these errors were encountered: