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

chaduke - Some funds might be stuck in the bank contract forever, and nobody can withdraw them #54

Closed
github-actions bot opened this issue Mar 1, 2023 · 0 comments
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue

Comments

@github-actions
Copy link

github-actions bot commented Mar 1, 2023

chaduke

medium

Some funds might be stuck in the bank contract forever, and nobody can withdraw them

Summary

Some funds might be stuck in the bank contract forever, and nobody can withdraw them.

Vulnerability Detail

We show below how some funds might be stuck in the bank contract forever.

  1. When BlueBerryBank.withdrawLend() is called, it will withdraw wAmount of the underlying tokens from the vault that corresponds to shareAmount of vault shares.

https://github.com/sherlock-audit/2023-02-blueberry/blob/main/contracts/BlueBerryBank.sol#L669-L704

  1. However, when wAmount > pos.underlyingAmount, only pos.underlyingAmount of underlying tokens will be sent back to the user (minus the fee), the remaining wAmount - pos.underlyingAmount underlying tokens will be stuck in the bank contract.

  2. There are no functions that will allow an owner/admin to withdraw these locked funds, they are lost.

Impact

Some funds might be locked in the bank contract and thus lost forever.

Code Snippet

See above

Tool used

Remix, VScode

Manual Review

Recommendation

The withdrawLend() function should send all these tokens back to the user.

Duplicate of #109

@github-actions github-actions bot added Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue labels Mar 1, 2023
@github-actions github-actions bot closed this as completed Mar 1, 2023
@sherlock-admin sherlock-admin added the Reward A payout will be made for this issue label Mar 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label High A valid High severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

1 participant