DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: low
Invalid

The Perpetual vault protocol

Hypothetical Vulnerability Report (Example Only
Subject: Potential Invariant Violation: Depositor Share Value Preservation
Summary:
A potential vulnerability exists related to the "Depositor Share Value Preservation" invariant. While the README states that "the value of a depositor's shares should never decrease due to the actions of other depositors," certain scenarios involving funding fees and withdrawals might lead to a violation of this invariant.
Vulnerability Details:

  • Funding Fees Accumulation: The README mentions that "depositors... should not be able to claim more than their fair share of positive funding fees or pay more than their share of negative funding fees." However, it also states, "There could be delays in claiming some funding fees." This delay could create a situation where a depositor withdraws their funds before funding fees are distributed, leaving the remaining depositors with a proportionally smaller share of the accumulated fees when they are eventually distributed.

  • Withdrawal Timing and Share Value: If a large depositor withdraws their funds immediately before funding fees are distributed, the remaining depositors' share value might decrease. This is because the total pool value (including accumulated fees) is reduced by the withdrawal, but the withdrawing depositor did not receive their proportional share of the fees, effectively transferring a small portion of that value to the remaining depositors.
    Impact:
    This vulnerability could result in depositors receiving a slightly lower return than expected due to a decrease in their share value caused by the timing of withdrawals and funding fee distribution. While the README mentions "there shouldn't be any material loss," even a small deviation from the invariant could be considered a vulnerability if it's not properly disclosed or understood by users.
    Tools Used:

  • (Hypothetically) Foundry or Hardhat for local testing and simulating different withdrawal and funding fee scenarios.

  • (Hypothetically) Echidna or Slither for static analysis of the smart contract code to identify potential invariant violations.
    Recommendations:

  • Clarify Funding Fee Distribution Logic: Provide more detailed information in the documentation about how and when funding fees are distributed, including specific examples of how withdrawals affect the distribution.

  • Consider Share Value Recalculation: Explore the possibility of recalculating share values immediately before funding fee distribution to ensure that withdrawing depositors receive their fair share of the accumulated fees. This might involve a mechanism to track and distribute pending fees associated with each user's shares.

  • Formal Verification: Employ formal verification tools to mathematically prove that the "Depositor Share Value Preservation" invariant holds under all possible scenarios, including varying withdrawal times and funding fee distributions.

  • User Education: Clearly communicate the potential impact of withdrawal timing on share value to users to manage expectations and avoid misunderstandings.
    Important Notes:

  • This is a hypothetical example. Do not attempt to use this information to exploit any real system.

  • Responsible disclosure is crucial. If you believe you have found a real vulnerability, report it directly to the project team through their designated channels.

  • Provide clear and concise information. Include all necessary details to allow the project team to understand and reproduce the vulnerability.

Updates

Lead Judging Commences

n0kto Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality
Assigned finding tags:

Suppositions

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.

Support

FAQs

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