Submitted by csanuragjain, also found by bin2chen, cergyk, evan, 7siech, obront, KIntern_NA, Koolex, and unforgiven
An unapproved, non-owner of collateral can still take loan for the owner/operator of collateral even when owner did not needed any loan. This is happening due to incorrect checks as shown in POC. This leads to unintended loan and associated fees for users.
a. User X is not owner of passed collateral
b. User X is not approved for this collateral
c. User X is not approved for all of User Y token
Revise the condition as shown below:
SantiagoGregory (Astaria) confirmed via duplicate issue #565
