You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
github-actionsbot opened this issue
Mar 1, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
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.
When BlueBerryBank.withdrawLend() is called, it will withdraw wAmount of the underlying tokens from the vault that corresponds to shareAmount of vault shares.
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.
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.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
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.
BlueBerryBank.withdrawLend()
is called, it will withdrawwAmount
of the underlying tokens from the vault that corresponds toshareAmount
of vault shares.https://github.com/sherlock-audit/2023-02-blueberry/blob/main/contracts/BlueBerryBank.sol#L669-L704
However, when
wAmount > pos.underlyingAmount
, onlypos.underlyingAmount
of underlying tokens will be sent back to the user (minus the fee), the remainingwAmount - pos.underlyingAmount
underlying tokens will be stuck in the bank contract.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
The text was updated successfully, but these errors were encountered: