Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

SolidityATL - Vulnerable unpause logic flow lead to unfair forced liquidations #168

Closed
sherlock-admin opened this issue Jun 15, 2023 · 3 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue Sponsor Disputed The sponsor disputed this issue's validity

Comments

@sherlock-admin
Copy link
Contributor

sherlock-admin commented Jun 15, 2023

SolidityATL

medium

Vulnerable unpause logic flow lead to unfair forced liquidations

Summary

Before pausing a protocol a position can be in good health.Once the protocol is paused that position cannot be updated. After resuming a pause, the position can immediately be liquidated if the positions falls below maintenance after settlement. This doesn't give the borrower a fair advantage to keep their collateral above
maintenance.

Vulnerability Detail

  1. Borrower opens a position
  2. Perennial admins pause the protocol for unknown reason (handle attacks, upgrades, etc)
  3. Borrower is incapable of updating their position to maintain good health (good maintenance)
  4. Perennial admins unpause the protocol
  5. Borrower instantly becomes liquidated by adversaries or bots when protocol resumes

Impact

Borrowers are liquidated without given the chance to credit their account to keep a healthy maintenance level on their open positions

Code Snippet

https://github.com/sherlock-audit/2023-05-perennial/blob/main/perennial-mono/packages/perennial/contracts/collateral/Collateral.sol#L108-L135

Tool used

Manual Review

Recommendation

The recommendation is to incorporate a threshold period (ie. 3hrs) so borrowers can update their positions to a healthy level after the protocol is unpaused.

Duplicate of #190

@KenzoAgada
Copy link
Collaborator

This can be considered as an un-mandatory "idea for improvement", but I think that the risk is there so this is a reasonable submission, and if I recall correctly, was accepted by Sherlock judges in the past.

@arjun-io arjun-io added Sponsor Confirmed The sponsor acknowledged this issue is valid Sponsor Disputed The sponsor disputed this issue's validity and removed Sponsor Confirmed The sponsor acknowledged this issue is valid labels Jun 21, 2023
@arjun-io
Copy link

By introducing a time delay to allow traders to optionally increase their collateral to meet maintenance requirements the Product runs the risk of going into further shortfall if the traders opt to not increase their margin. The fairest option for both liquidators and other traders in the protocol is to require that traders are paying attention and self-liquidate (to retain the fee) if they so chose.

@KenzoAgada
Copy link
Collaborator

As per previous comments, while the issue is not unworthy in my opinion, considering it more of a design choice than a proper problem. Closing.

@sherlock-admin sherlock-admin added Non-Reward This issue will not receive a payout and removed Medium A valid Medium severity issue Has Duplicates A valid issue with 1+ other issues describing the same vulnerability labels Jun 29, 2023
@sherlock-admin sherlock-admin added Reward A payout will be made for this issue Medium A valid Medium severity issue Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label and removed Non-Reward This issue will not receive a payout labels Jul 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue Sponsor Disputed The sponsor disputed this issue's validity
Projects
None yet
Development

No branches or pull requests

3 participants