Skip to content
DoS Audit finding Intermediate

No way to remove GasThrottle after deployment

The GasThrottle contract checks that the user's gas price is below a value from an oracle, and if that oracle is compromised to return zero, all swaps fail with no way to recover.

TomFrenchBlockchain Follow

Originally disclosed on Code4rena

Submitted by TomFrenchBlockchain

Impact

Potential DOS on swaps

Proof of Concept

BasePool and BasePoolV2 make 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-11-vader/blob/429970427b4dc65e37808d7116b9de27e395ce0c/contracts/dex/utils/GasThrottle.sol#L9-L20

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

SamSteinGG (Vader) confirmed

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 gas throttle relies on an external oracle without any governance mechanism to disable it, so a compromised or malfunctioning oracle permanently blocks swaps.

Impact

If the gas oracle is compromised to return zero, all swaps fail, causing a denial of service with no recovery path.

What the attacker needed

Compromised gas oracle

The fix

The gas throttle should be removed entirely or governance should be able to turn it off.

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 safety check that compares the gas price you pay to a value from an outside source. If that outside source is tricked into giving a very low number, every swap fails and the contract cannot be fixed because there is no switch to turn the check off.

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.