Skip to content
Business logic Audit finding Intermediate

PerpDepository has no way to withdraw profits depriving stakers of profits owed

The PerpDepository contract lacks a function to calculate or withdraw profits generated by its delta-neutral strategy, so profits owed to stakers become trapped in the contract. An attacker cannot directly exploit this, but stakers lose revenue because the funds cannot be accessed without a contract upgrade.

0x52 Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-01-uxd-judging/issues/251

Found by

0x52

Summary

PerpDepository has no way to calculate or withdraw any profits made by the vault. By design stakes are entitled to a portion of the profits generated by the delta-neutral strategy. The issue is that the vault never implements a way to withdraw profits to stakers, resulting in loss of revenue for them.

Vulnerability Detail

See summary.

Impact

Profits owed stakers will be trapped in the contract and they will lose that portion of their revenue

Code Snippet

https://github.com/sherlock-audit/2023-01-uxd/blob/main/contracts/integrations/perp/PerpDepository.sol#L25

Tool used

Manual Review

Recommendation

Create a function to calculate and withdraw protocol profit to be awarded to stakers

Discussion

WarTech9

Profits on PerpDepository are currently locked in the depository and can be unlocked in future updates through positive PnL rebalancing. RageDepository profits are locked in that contract and can be withdrawn by the contract owner (governance) through the withdrawProfits() function

rvierdiyev

Escalate for 11 USDC.

This is not a vulnerability. As @WarTech9 said,

RageDepository profits are locked in that contract and can be withdrawn by the contract owner (governance) through the withdrawProfits() function

This is design choice of protocol. I have discussed that during the contest with @WarTech9, so he explained me that and i didn't submit that as issue. As he said, that rewards are not lost and governance can withdraw it later to reuse.

Also author of report states in impact section that:

Profits owed stakers will be trapped in the contract and they will lose that portion of their revenue

But this is not true, as i described above, that value is not stucked as protocol can withdraw it.

sherlock-admin

Escalate for 11 USDC.

This is not a vulnerability. As @WarTech9 said,

RageDepository profits are locked in that contract and can be withdrawn by the contract owner (governance) through the withdrawProfits() function

This is design choice of protocol. I have discussed that during the contest with @WarTech9, so he explained me that and i didn't submit that as issue. As he said, that rewards are not lost and governance can withdraw it later to reuse.

Also author of report states in impact section that:

Profits owed stakers will be trapped in the contract and they will lose that portion of their revenue

But this is not true, as i described above, that value is not stucked as protocol can withdraw it.

You've created a valid escalation for 11 USDC!

To remove the escalation from consideration: Delete your comment. To change the amount you've staked on this escalation: Edit your comment (do not create a new comment).

You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.

hrishibhat

Escalation rejected

This is in PerpDepository and not RageDepository. Profits in PerpDepository are stuck with no method to unlock them except while upgrading the contract. Although contract upgrades are to be used for feature updates and add changes to handle extreme situations, this issue is clearly a smart contract bug where funds are locked.

sherlock-admin

Escalation rejected

This is in PerpDepository and not RageDepository. Profits in PerpDepository are stuck with no method to unlock them except while upgrading the contract. Although contract upgrades are to be used for feature updates and add changes to handle extreme situations, this issue is clearly a smart contract bug where funds are locked.

This issue's escalations have been rejected!

Watsons who escalated this issue will have their escalation amount deducted from their next payout.

WarTech9

This is not a valid issue. This is conflating RageDnDepository and PerpDepository. PerpDepository does not need a way to withdraw profits as there is none, since it applies a delta-neutral strategy. RageDnDepository already has a withdrawProfits() function

hrishibhat

Considering this issue valid, since the funds are stuck in the contract until an upgrade.

The original report as published on Sherlock, by 0x52. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The contract lacks a function to calculate and withdraw profits, so earned profits remain locked.

Impact

Profits owed to stakers are trapped in the contract and cannot be withdrawn without a contract upgrade, causing stakers to lose that revenue.

What the attacker needed

None

The fix

A function should be added to calculate and withdraw protocol profit so it can be awarded to stakers.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract holds money for a group of people (stakers). The contract is supposed to share some of the profit it makes with those stakers, but it has no built-in way to send that profit out. So the profit stays stuck inside the contract, and the stakers never receive it.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by 0x52

View all

211 more disclosed reports, best first.

More from UXD Protocol

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.