Open sherlock-admin opened 1 year ago
Thank you for this feedback. This is a high severity issue as it could be used to unexpectedly steal tokens that another use had previously approved to the contract. Will fix.
Fix looks good. _commitment.lender (updated lender) is now required to be msg.sender
0x52
high
Malicious user can abuse UpdateCommitment to create commitments for other users
Summary
UpdateCommitment checks that the original lender is msg.sender but never validates that the original lender == new lender. This allows malicious users to effectively create a commitment for another user, allowing them to drain funds from them.
Vulnerability Detail
LenderCommitmentForwarder.sol#L208-L224
UpdateCommitment is intended to allow users to update their commitment but due to lack of verification of _commitment.lender, a malicious user create a commitment then update it to a new lender. By using bad loan parameters they can steal funds from the attacker user.
Impact
UpdateCommitment can be used to create a malicious commitment for another user and steal their funds
Code Snippet
LenderCommitmentForwarder.sol#L208-L233
Tool used
Manual Review
Recommendation
Check that the update lender is the same the original lender