Skip to content
Business logic Audit finding Intermediate

Users can be forced to claim assets at bad rate in some cases

The balanced vault contract allows anyone to call the claim function for another account, so a malicious user can force other users to claim assets when the pro-rata mechanism would give them less than expected. This causes victims to realise losses they would otherwise have avoided.

mstpr-brainbot Follow with rvierdiiev and tvdung94

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2023-05-perennial-judging/issues/174

Found by

mstpr-brainbot, rvierdiiev, tvdung94

Summary

In balanced vault contract, anyone can call claim assets for other accounts; malicious users could abuse this function to force other users to receive less assets than they expect.

Vulnerability Detail

When claiming asset, pro rate, in which users will receive less assets than expect, will be applied when total collateral is less than total unclaimed amount. So after redeeming shares and converting it to assets, users might not want to claim assets right away in this scenario, for they will receive less token amount. However, other users can force them to claim via claim() function because there is no restrict on this function to claim for other accounts.

Impact

Users will be forced to receive less assets in some scenarios.

Code Snippet

https://github.com/sherlock-audit/2023-05-perennial/blob/main/perennial-mono/packages/perennial-vaults/contracts/balanced/BalancedVault.sol#L211-L228

Tool used

Manual Review

Recommendation

Only account owner (msg.sender == account) can claim asset for their account.

Discussion

KenzoAgada

While the general claim pro-rata mechanism has already been reported in the Veriside audit (issue 002) and acknowledged by the protocol, this submission correctly adds that a user can pro-rata claim other user's assets, even if they preferred to avoid realizing losses and stay in the vault until collateral recovers. This will make users lose funds, and increase the malicious user's own amount of rewards, for when the collateral recovers.

arjun-io

This is a great find. We will think about whether or not we want to fix this as the unpermissioned claim is currently used by the protocol for better UX with the MultiInvoker

The original report as published on Sherlock, by mstpr-brainbot. 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 claim function lacks an access control check ensuring that only the account owner can claim for their own account.

Impact

Users can be forced to receive less assets than they expect, realising losses they would have avoided, while the malicious user's own rewards increase when collateral recovers.

What the attacker needed

Victim has unclaimed assets in the vault; total collateral is less than total unclaimed amount

The fix

The claim function should be restricted so that only the account owner can claim assets for their account.

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 vault is a shared pot of money. When there is not enough to pay everyone in full, withdrawals are reduced proportionally (pro rata). Normally a user could wait until the pot recovers before claiming, but here anyone can trigger a claim on someone else's behalf, locking in the loss.

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 mstpr-brainbot

View all

43 more disclosed reports, best first.

More from Perennial V2 Update #1

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.