Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nikhilx0111 - reentrancy in manager.sol #74

Open
sherlock-admin3 opened this issue Sep 13, 2024 · 0 comments
Open

nikhilx0111 - reentrancy in manager.sol #74

sherlock-admin3 opened this issue Sep 13, 2024 · 0 comments

Comments

@sherlock-admin3
Copy link

sherlock-admin3 commented Sep 13, 2024

nikhilx0111

High

reentrancy in manager.sol

Summary

the external executeorder function in manager.sol executes a order if its executable after executing the order it sets the order.isSpent to true this should happen before the order is executed a user can reenter the execute function and execute a order again due to the order.isSpent = true; being outdated

Root Cause

https://github.com/sherlock-audit/2024-08-perennial-v2-update-3/blob/main/perennial-v2/packages/perennial-order/contracts/Manager.sol#L133

Internal pre-conditions

the order just needs to be executable to perform this attack

External pre-conditions

No response

Attack Path

No response

Impact

a malicious user can reenter a already spent order and execute it again

PoC

No response

Mitigation

set the order.isSpent = true; before executing the order

@sherlock-admin3 sherlock-admin3 changed the title Brave Crimson Yak - reentrancy in manager.sol nikhilx0111 - reentrancy in manager.sol Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant