A comprehensive security audit of PerpetualVault.sol has identified several critical vulnerabilities and design concerns, with the most severe being potential reentrancy attacks in withdrawal functions.
Reentrancy Vulnerability in Withdrawal Flow
The withdrawal flow makes external calls through token transfers and interactions with external protocols before updating critical state variables, creating potential reentrancy vectors.
Missing State Validation
Critical: Potential reentrancy attacks could lead to:
Double withdrawals
Manipulation of share calculations
Theft of user funds
Protocol insolvency
High: Missing state validations could result in:
Incorrect share calculations
Unauthorized withdrawals
Broken accounting
Manual code review
Echidna for property-based testing
Foundry for unit testing
Implement Reentrancy Guards
Follow CEI Pattern
Add State Validations
Implement Circuit Breakers
Add Event Emissions for Critical State Changes
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.
There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.