Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VaderPoolV2.rescue results in loss of funds rather than recoverability #251

Open
code423n4 opened this issue Nov 15, 2021 · 3 comments
Open
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working VaderPoolV2

Comments

@code423n4
Copy link
Contributor

Handle

TomFrench

Vulnerability details

Impact

Any unaccounted for tokens on VaderPoolV2 can be siphoned off by anyone

Proof of Concept

VaderPoolV2 has a rescue function which allows any unaccounted for tokens to be recovered.

https://github.com/code-423n4/2021-11-vader/blob/429970427b4dc65e37808d7116b9de27e395ce0c/contracts/dex-v2/pool/BasePoolV2.sol#L505-L517

However there is no access control on this function which means than should any tokens be sent to VaderPoolV2 by accident they'll just be scooped up by flashbots rather than being recoverable by the original owner or Vader governance.

This also means that any rebasing tokens which are deposited into VaderPoolV2 will have any rebases lost rather than being recoverable by Vader governance.

Recommended Mitigation Steps

Permission this function to only allow Vader governance to claim tokens.

@code423n4 code423n4 added 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working labels Nov 15, 2021
code423n4 added a commit that referenced this issue Nov 15, 2021
@SamSteinGG
Copy link
Collaborator

Duplicate #28

@SamSteinGG SamSteinGG added the duplicate This issue or pull request already exists label Nov 25, 2021
@alcueca alcueca reopened this Dec 10, 2021
@alcueca alcueca closed this as completed Dec 10, 2021
@alcueca alcueca removed the duplicate This issue or pull request already exists label Dec 11, 2021
@alcueca
Copy link
Collaborator

alcueca commented Dec 11, 2021

Not a duplicate, this issue correctly states that the function is vulnerable to front-running.

@alcueca alcueca reopened this Dec 11, 2021
@SamSteinGG
Copy link
Collaborator

The function is equivalent to the Uniswap V2 rescue function which is not classified as incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value bug Something isn't working VaderPoolV2
Projects
None yet
Development

No branches or pull requests

4 participants