code-423n4 / 2022-08-frax-findings

2 stars 1 forks source link

there is no calculation or checks for `LTV` #286

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Lines of code

https://github.com/code-423n4/2022-08-frax/blob/main/src/contracts/FraxlendPairCore.sol#L739-L758 https://github.com/code-423n4/2022-08-frax/blob/main/src/contracts/FraxlendPairCore.sol#L786-L789

Vulnerability details

Impact

The users decide how much Collateral to send and how many assets to borrow

Proof of Concept

In the Functions: Borrowing part exactly with borrowAsset() and addCollateral() there is no calculation or checks for LTV so the users just pass any amount and it will apply

Recommended Mitigation Steps

Add more checks for LTV

amirnader-ghazvini commented 2 years ago

Duplicate of #283