Submitted by Arabadzhiev, also found by Arabadzhiev, DadeKuma, Koolex, and rvierdiiev
src/processor/swapback.rs#L185
src/processor/swapback.rs#L192
src/context/repay_sol.rs#L23
Borrowers can avoid the payment of the 20% interest share fee on their accumulated interest.
The current implementation of the repay_sol function sends a 20% interest share fee to the specified fee_receipient account that is passed in to it. However, as it can be seen, that account is a user specified one:
What this means, is that the user can take advantage of that and avoid the payment of an interest share fee by simply passing in a public key that is controlled by them for that value. It is unclear who exactly is supposed to be the on the receiving end for the fee payment, but whats important is that that they can easily be easily be prevented from receiving it.
Apply some restrictions on the fee_receipient public key value. For example, you can make it be a property of the Pool struct that is set on the creation of each new trading pool by its operator.
Invalid Validation
piske-alex (Lavarage) confirmed
