Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 1.38 KB

093.md

File metadata and controls

61 lines (40 loc) · 1.38 KB

Obedient Umber Osprey

Medium

No nonReentrant in leverageStrategy and closeLeverageStrategy.

Summary

there is no nonReentrant modifier in leverageStrategy and closeLeverageStrategy.as we are calling accrueInterest in the above function.

Root Cause

https://github.com/sherlock-audit/2024-12-numa-audit/blob/main/Numa/contracts/lending/CNumaToken.sol#L148 function leverageStrategy( uint _suppliedAmount, uint _borrowAmount, CNumaToken _collateral, uint _strategyIndex ) external { // AUDITV2FIX if we don't do that, borrow balance might change when calling borrowinternal accrueInterest(); _collateral.accrueInterest();

https://github.com/sherlock-audit/2024-12-numa-audit/blob/main/Numa/contracts/lending/CNumaToken.sol#L269 function closeLeverageStrategy( CNumaToken _collateral, uint _borrowtorepay, uint _strategyIndex ) external { // AUDITV2FIX accrueInterest(); _collateral.accrueInterest();

    INumaLeverageStrategy strat = INumaLeverageStrategy(
        leverageStrategies.at(_strategyIndex)
    );

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

No response

PoC

No response

Mitigation

use nonReentrant modifier in leverageStrategy and closeLeverageStrateg