DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: high
Valid

Flow is not reset after deposit for 1x leverage long position and swapping only with DEX

Summary

Flow is not reset after deposit for 1x leverage long position and swapping only with DEX which will need manual intervention of owner to remove the current flow so future deposit/withdraw actions are available.

Vulnerability Details

Deposit and withdraw operations are possible only when there is not an ongoing flow and after finalization of each flow, flow value is reset so new operations are available.

We have the followin workflow when depositing in 1x leverage long vault and only DEX is used for swap:

User calls deposit() -> Keeper calls runNextAction() -> _runSwap() is internally called in runNextAction() -> swap via DEX is done -> _mint() is called to account for users shares

There is not a flow reset which will lead to temporary DoS.

Impact

DoS

Tools Used

Manual review.

Recommendations

Consider calling setting next action to FINALIZE like how it is done for other workflows.

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding_deposit_1x_long_dex_positionIsOpened_DoS_Flow

Likelihood: Medium/High, - Leverage = 1x - beenLong = True - positionIsClosed = False - Metadata → 1 length and Dex Swap Impact: Medium/High, DoS on any new action before the admin uses setVaultState Since this seems to be the most probable path for a 1x PerpVault, this one deserves a High.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!