Can't pay fees when paying debt #189
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
duplicate-196
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/with-backed/papr/blob/9528f2711ff0c1522076b9f93fba13f88d5bd5e6/src/PaprController.sol#L208
Vulnerability details
Impact
In PaprController#buyAndReduceDebt, the user has the ability to pay debt using the underlying token, delegating to the contract swapping the tokens for Papr tokens.
Alternatively to increaseDebtAndSell, during the transaction the controller never has any underlying tokens, so in any instance where the fee is set up to be paid, it will fail.
Proof of Concept
Confirm the behavior with the following test, adapted from
BuyAndReduceDebt
.Tools Used
Manual, Foundry
Recommended Mitigation Steps
Use
transferFrom
if it is expected to pay using the users permission or ensure that the controller has enough underlying tokens to pay the expected amount.The text was updated successfully, but these errors were encountered: