VaderPoolV2.rescue results in loss of funds rather than recoverability
The VaderPoolV2 contract's rescue function lacks access control, allowing anyone to claim unaccounted tokens. An attacker could front-run and steal tokens accidentally sent to the contract or rebase rewards.
Originally disclosed on Code4rena
Submitted by TomFrenchBlockchain
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.
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.
Duplicate #28
Not a duplicate, this issue correctly states that the function is vulnerable to front-running.
The function is equivalent to the Uniswap V2 rescue function which is not classified as incorrect.
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 rescue function lacks access control, allowing any caller to withdraw tokens.
Impact
Any tokens accidentally sent to the contract or rebase rewards could be stolen by front-running attackers.
What the attacker needed
Tokens sent to contract by mistake; attacker can front-run
The fix
The rescue function should be restricted to only allow Vader governance to claim tokens.
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 smart contract has a function meant to recover tokens sent by mistake. But anyone can call it, so a malicious actor can quickly take those tokens before the rightful owner or the project's governance can.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.