Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.26 KB

Anyone can liquidate on behalf of another account.md

File metadata and controls

31 lines (24 loc) · 1.26 KB

The Perpetual contract has a public liquidateFrom function that bypasses the checks in the liquidate function.

This means that it can be called to liquidate a position when the contract is in the SETTLED state.

Additionally, any user can set an arbitrary from address, causing a third-party user to confiscate the under-collateralized trader’s position.

This means that any trader can unilaterally rearrange another account’s position.

They could also liquidate on behalf of the Perpetual Proxy, which could break some of the Automated Market Maker invariants, such as the condition that it only holds LONG positions.

Recommendation:

Consider restricting liquidateFrom to internal visibility


Slide Screenshot

097.png


Slide Text

  • OpenZeppelin Audit MCDEX Mai Finding C01
  • Access Control
  • Critical Severity
  • liquidateFrom -> Public Visibility
  • Change Visibility Public -> Internal

References


Tags