sherlock-audit / 2023-12-flatmoney-judging

11 stars 9 forks source link

DJINN - Liquidate other user's positions without intent or permissions #116

Closed sherlock-admin2 closed 8 months ago

sherlock-admin2 commented 8 months ago

DJINN

high

Liquidate other user's positions without intent or permissions

Summary

A user's position can be liquidated by anyone as long as they have the tokenID for the NFT representing the position.

Vulnerability Detail

The liquidate() function does not check if the provided tokenID has an associated order or if the caller is permitted to liquidate the position. This enables malicious users to liquidate any long position in the protocol.

Impact

Code Snippet

Tool used

Manual Review

Recommendation

sherlock-admin commented 8 months ago

1 comment(s) were left on this issue during the judging contest.

takarez commented:

invalid

nevillehuang commented 8 months ago

Invalid, liquidation should be performed by any liquidator as long as the position can be liquidated, wherein users position has margin below acceptable liquidation margin