Minting public vault shares while the protocol is paused can lead to LP fund loss
The PublicVault contract's mint function lacks the whenNotPaused modifier that deposit has, allowing LPs to deposit assets while the protocol is paused. This could lead to LP fund loss depending on the reason for the pause and the incident response.
Source: https://github.com/sherlock-audit/2022-10-astaria-judging/issues/174
Found by
0xRajeev, TurnipBoy
Summary
Assets can be deposited into public vaults by LPs with PublicVault.mint function to bypass a possible paused protocol.
Vulnerability Detail
The PublicVault contract prevents calls to the PublicVault.deposit function while the protocol is paused by using the whenNotPaused modifier.
The PublicVault contract extends the ERC4626Cloned contract, which has two functions to deposit assets into the vault: the deposit function and the mint function. The latter function, however, is not overwritten in the PublicVault contract and therefore lacks the appropriate whenNotPaused modifier.
Impact
LPs can deposit assets into public vaults with the PublicVault.mint function to bypass a possible paused protocol. This can lead to LP fund loss depending on the reason for the protocol pause and the incident response.
Code Snippet
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/PublicVault.sol#L222
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/lib/astaria-gpl/src/ERC4626-Cloned.sol#L324
Tool used
Manual Review
Recommendation
Override the mint function and add the whenNotPaused modifier
Discussion
IAmTurnipBoy
Escalate for 1 USDC
Causes material loss of funds. Should be high risk
sherlock-admin
Escalate for 1 USDC
Causes material loss of funds. Should be high risk
You've created a valid escalation for 1 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.
Evert0x
Escalation rejected.
This issue depends on the pausable state being active, also, it has the potential to lead to a loss of funds, it's not a guarantee.
sherlock-admin
Escalation rejected.
This issue depends on the pausable state being active, also, it has the potential to lead to a loss of funds, it's not a guarantee.
This issue's escalations have been rejected!
Contestants' payouts and scores will not be updated.
Auditors who escalated this issue will have their escalation amount deducted from future payouts.
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
Impact
LPs could deposit assets into public vaults via mint while the protocol is paused, potentially leading to LP fund loss depending on the reason for the pause and the incident response.
What the attacker needed
Protocol is paused
The fix
Override the mint function and add the whenNotPaused modifier.
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 lets people put in money (deposit) and get shares. The protocol can be paused to stop deposits, but one way to deposit (mint) was not blocked. So people could still put money in during a pause, which might cause problems if the pause was for an emergency.
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.