Skip to content
This repository has been archived by the owner on Dec 17, 2023. It is now read-only.

tvdung94 - Users can be forced to claim assets at bad rate in some cases #174

Open
sherlock-admin opened this issue Jun 15, 2023 · 3 comments
Labels
Has Duplicates A valid issue with 1+ other issues describing the same vulnerability Medium A valid Medium severity issue Reward A payout will be made for this issue Sponsor Confirmed The sponsor acknowledged this issue is valid Will Fix The sponsor confirmed this issue will be fixed

Comments

@sherlock-admin
Copy link
Contributor

tvdung94

medium

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

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.

@github-actions github-actions bot added Medium A valid Medium severity issue Has Duplicates A valid issue with 1+ other issues describing the same vulnerability labels Jun 19, 2023
@KenzoAgada
Copy link
Collaborator

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 arjun-io added Sponsor Confirmed The sponsor acknowledged this issue is valid Won't Fix The sponsor confirmed this issue will not be fixed and removed Won't Fix The sponsor confirmed this issue will not be fixed labels Jun 21, 2023
@arjun-io
Copy link

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

@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Jun 29, 2023
@arjun-io arjun-io added the Will Fix The sponsor confirmed this issue will be fixed label Jul 24, 2023
@arjun-io
Copy link

Fixed: equilibria-xyz/perennial-mono#206 - this change only allows "self" claims if the vault is pro-rated

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Has Duplicates A valid issue with 1+ other issues describing the same vulnerability Medium A valid Medium severity issue Reward A payout will be made for this issue Sponsor Confirmed The sponsor acknowledged this issue is valid Will Fix The sponsor confirmed this issue will be fixed
Projects
None yet
Development

No branches or pull requests

3 participants