code-423n4 / 2021-06-tracer-findings

1 stars 0 forks source link

inclusive check that account is not above minimum margin #109

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

pauliax

Vulnerability details

Impact

Here the check currentMargin < Balances.minimumMargin should be inclusive <= to indicate the account is not above minimum margin: require( currentMargin <= 0 || uint256(currentMargin) < Balances.minimumMargin(pos, price, gasCost, tracer.trueMaxLeverage()), "LIQ: Account above margin" );

Recommended Mitigation Steps

uint256(currentMargin) <= Balances.minimumMargin ...