code-423n4 / 2024-04-revert-mitigation-findings

1 stars 1 forks source link

M-19 MitigationConfirmed #51

Open c4-bot-6 opened 5 months ago

c4-bot-6 commented 5 months ago

Lines of code

Vulnerability details

C4 Issue

M-19: https://github.com/code-423n4/2024-03-revert-lend-findings/issues/175

Issue Details

V3Oracle.sol contract is used by Revert Lend protocol to fetch all prices. For maximum safety and manipulation resistance it uses two oracles (Uniswap TWAP & Chainlink).

Calculating the collateral value of a position was conducted inside V3Oracle.getValue() as product of two parameters:

The vulnerability lied in the second parameter that was using spot data from the pool, which could influence the calculated position value.

Mitigation

PR-26 successfully mitigates the original issue by modifying the calculations for amount0/amount1 to be based on the derived oracle price instead on the spot data.

Additional code refactoring has been made so that the code is leaner and more organized

Conclusion

Mitigation Confirmed

c4-judge commented 5 months ago

jhsagd76 marked the issue as satisfactory