Consent in MutualConsent
is not removable
#61
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-33
satisfactory
Finding meets requirement
Lines of code
https://github.com/debtdao/Line-of-Credit/blob/audit/code4rena-2022-11-03/contracts/utils/MutualConsent.sol#L38-L60
https://github.com/debtdao/Line-of-Credit/blob/audit/code4rena-2022-11-03/contracts/utils/MutualConsent.sol#L31-L36
Vulnerability details
Impact
Borrower or Lender can't remove their consent from
MutualConsent
if they need.Proof of Concept
MutualConsent
hasmutualConsent
modifier which is used to protect functions that need to have consent of 2 parties before call. Example of such function isLineOfCredit.addCredit
.This is how mutual consent checking works
https://github.com/debtdao/Line-of-Credit/blob/audit/code4rena-2022-11-03/contracts/utils/MutualConsent.sol#L38-L60
As you can see the function store consent of first caller and then waits when another caller will call same function.
There is no any ability to remove this contest.
How this can be used?
For example at t1 lender and borrower aggreed on some credit for amount of tokens and specific fee rates. Then borrower calls
createCredit
and his consent is stored.But lender do not call
createCredit
.After some time smth happened and rates changed, so it's not good credit conditions for a borrower anymore, but very good for lender.
And lender calls
createCredit
. As borrower consent already stored, this credit will be created and fees will start accumulate.Tools Used
VsCode
Recommended Mitigation Steps
Add ability to remove consent, or think about some expiration time for consents.
The text was updated successfully, but these errors were encountered: