Anyone can deposit and mint withdrawal proxy shares to capture distributed yield from borrower interests
The WithdrawProxy contract inherits deposit and mint functions from ERC4626Cloned, allowing anyone to deposit WETH and receive shares. An attacker could deposit just before yield is distributed and redeem for a profit, diluting returns for legitimate LPs.
Source: https://github.com/sherlock-audit/2022-10-astaria-judging/issues/176
Found by
0xRajeev, bin2chen, TurnipBoy, 0x4141
Summary
Anyone can deposit and mint Withdrawal proxy shares by directly interacting with the base ERC4626Cloned contract's functions, allowing them to capture distributed yield from borrower interests.
Vulnerability Detail
The WithdrawProxy contract extends the ERC4626Cloned vault contract implementation. The ERC4626Cloned contract has the functionality to deposit and mint vault shares. Usually, withdrawal proxy shares are only distributed via the WithdrawProxy.mint function, which is only called by the PublicVault.redeemFutureEpoch function. Anyone can deposit WETH into a deployed Withdraw proxy to receive shares, wait until assets (WETH) are deposited via the PublicVault.transferWithdrawReserve or LiquidationAccountant.claim function and then redeem their shares for WETH assets.
Impact
By depositing/minting directly to the Withdraw proxy, one can get interest yield on-demand without being an LP and having capital locked for epoch(s). This may potentially be timed in a way to deposit/mint only when we know that interest yields are being paid by a borrower who is not defaulting on their loan. The returns are diluted for the LPs at the expense of someone who directly interacts with the underlying proxy.
Code Snippet
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/lib/astaria-gpl/src/ERC4626-Cloned.sol#L305-L339
- https://github.com/sherlock-audit/2022-10-astaria/blob/main/src/PublicVault.sol#L198
Tool used
Manual Review
Recommendation
Overwrite the ERC4626Cloned.afterDeposit function and revert to prevent public deposits and mints.
Discussion
IAmTurnipBoy
Escalate for 1 USDC
This leads to material loss of funds. Definitely high risk
sherlock-admin
Escalate for 1 USDC
This leads to material loss of funds. Definitely 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 accepted
sherlock-admin
Escalation accepted
This issue's escalations have been accepted!
Contestants' payouts and scores will be updated according to the changes made on this issue.
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 WithdrawProxy inherits the public deposit and mint functions from ERC4626Cloned without restricting them, so anyone can mint shares directly instead of only through the intended PublicVault.redeemFutureEpoch path.
Impact
An attacker could capture interest yield without being an LP or locking capital for epochs, diluting returns for legitimate LPs.
What the attacker needed
A deployed WithdrawProxy contract; Ability to call deposit or mint functions
The fix
Override the ERC4626Cloned.afterDeposit function to revert, preventing public deposits and mints.
How it was found
- Deploy or identify a WithdrawProxy contract.
- Deposit WETH directly into the WithdrawProxy to receive shares.
- Wait for WETH to be deposited via PublicVault.transferWithdrawReserve or LiquidationAccountant.claim.
- Redeem the shares for WETH, capturing a portion of the yield.
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 contract lets people put in money and get shares. Normally only a specific function should create shares, but here anyone can call the deposit function directly. That means someone can put money in just before interest is paid out and take a share of that interest, leaving less for the real lenders.
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.