Skip to content
Business logic Audit finding Intermediate

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.

0xRajeev Follow with bin2chen, TurnipBoy and 1 other

Originally disclosed on Sherlock

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

  1. https://github.com/sherlock-audit/2022-10-astaria/blob/main/lib/astaria-gpl/src/ERC4626-Cloned.sol#L305-L339
  2. 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.

The original report as published on Sherlock, by 0xRajeev. 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 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

  1. Deploy or identify a WithdrawProxy contract.
  2. Deposit WETH directly into the WithdrawProxy to receive shares.
  3. Wait for WETH to be deposited via PublicVault.transferWithdrawReserve or LiquidationAccountant.claim.
  4. 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.

More by 0xRajeev

View all

61 more disclosed reports, best first.

More from Astaria

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.