Closed sherlock-admin3 closed 4 months ago
The protocol team fixed this issue in the following PRs/commits: https://github.com/0xCedar/elfi-perp-contracts/pull/31
Request poc
This seems correctly described but LSW comments seems to be accurate:
autoReducePositions always send isLiquidation as false which the actual "isCrossMargin" value is only used if the "isLiquidation" is true, so no impact here.
PoC requested from @amankakar
Requests remaining: 6
Request poc
This seems correctly described but LSW comments seems to be accurate:
autoReducePositions always send isLiquidation as false which the actual "isCrossMargin" value is only used if the "isLiquidation" is true, so no impact here.
I agree with LSW's comment. While it won't cause any issues with the current implementation, it could lead to problems in the future. As mentioned in the contest's ReadMe, Watson could report a issue, which posing risks for future integrations.
Should potential issues, like broken assumptions about function behavior, be reported if they could pose risks in future integrations, even if they might not be an issue in the context of the scope? If yes, can you elaborate on properties/invariants that should hold?
yes
Per consistency with beefy escalations, as seen here, future integrations must be explicitly stated if not it won't be considered.
Future issues: Issues that result out of a future integration/implementation that was not mentioned in the docs/README or because of a future change in the code (as a fix to another issue) are not valid issues.
The Lead Senior Watson signed off on the fix.
aman
Medium
_executeDecreaseOrder
passisCrossMargin=false
is not correct crossMargin valueSummary
While processing the decreasef position order we passed
isCrossMargin=false
with out considering that the positionisCrossMargin=true
.Vulnerability Detail
While in case of
autoReducePositions
we passed the correct value fromposition.isCrossMargin
.Impact
The Protocol will consider crossMargin position as isolate Position.
Code Snippet
https://github.com/sherlock-audit/2024-05-elfi-protocol/blob/main/elfi-perp-contracts/contracts/process/OrderProcess.sol#L414-L450
Tool used
Manual Review
Recommendation
pass correct value of
isCrossMargin
indecreasePosition