Skip to content
DoS Audit finding Intermediate

No way to remove GasThrottle from VaderPool after deployment

The pool contract applies a gas-price check on every swap using a value from an external gas oracle, and the throttle cannot be disabled after deployment. If that oracle were compromised to return zero, all swaps would fail permanently with no recovery path.

TomFrenchBlockchain Follow

Originally disclosed on Code4rena

Submitted by TomFrenchBlockchain

Potential DOS on swaps on VaderPool.

Proof of Concept

BasePool makes use of a validateGas modifier on swaps which checks that the user’s gas price is below the value returned by _FAST_GAS_ORACLE.

https://github.com/code-423n4/2021-12-vader/blob/fd2787013608438beae361ce1bb6d9ffba466c45/contracts/dex/pool/BasePool.sol#L292

https://github.com/code-423n4/2021-12-vader/blob/fd2787013608438beae361ce1bb6d9ffba466c45/contracts/dex/utils/GasThrottle.sol#L8-L22

Should _FAST_GAS_ORACLE be compromised to always return zero then all swaps will fail. There is no way to recover from this scenario.

Recommended Mitigation Steps

Either remove GasThrottle.sol entirely or allow governance to turn it off as is done in VaderPoolV2.sol


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

Likely the gas throttle reads a mutable external oracle and has no governance-controlled off switch, so a bad oracle value permanently blocks swaps.

Impact

If the gas oracle were compromised to return zero, every swap would fail and the pool could not recover, a potential denial of service.

What the attacker needed

Gas oracle compromised to return zero

The fix

The gas throttle should be removed entirely or governance should be able to disable it, as is done in the newer pool version.

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 is a program on a blockchain that cannot be changed once deployed. This pool checks the gas price (the fee paid to process a transaction) against a number supplied by an outside service, and if that number is zero every swap is rejected. Because there is no switch to turn the check off, the pool would be stuck forever.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

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.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.