Skip to content
Access control Audit finding Intermediate

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.

TomFrenchBlockchain Follow

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.

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.

SamSteinGG (Vader) commented:

Duplicate #28

alcueca (judge) commented:

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

SamSteinGG (Vader) commented:

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

The original report as published on Code4rena, by TomFrenchBlockchain. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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.

More by TomFrenchBlockchain

View all

28 more disclosed reports, best first.

More from Vader Protocol contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.