Skip to content
DoS Audit finding Intermediate

DDOS in BalLiquidityProvider

The contract required its asset balance to exactly equal a caller-supplied maximum amount, so anyone could send a tiny amount of the asset to break that equality. An attacker could repeatedly front-run liquidity providers, causing their function calls to always revert.

QuantumBrief Follow

Originally disclosed on Code4rena

Submitted by QuantumBrief

DDOS to liquidity providers in BalLiquidityProvider.

Proof of Concept

An attacker can front-run liquidity providers by sending 1 Wei of the asset to make the balance not equal to the input. This can be repeated and be used to impede the liquidity provider from using the function which will always revert since bal != _request.maxAmountsIn[i]

Recommended Mitigation Steps

Balances shouldn’t be required to be equal to an input variable. An attacker can always make the balance a little bigger. This check should be removed or changed to require (bal >= _request.maxAmountsIn[i]).

0xMaharishi (Aura Finance) acknowledged, but disagreed with severity and commented:

Fair report 👍

0xMaharishi (Aura Finance) resolved:

code-423n4/2022-05-aura#6 code4rena aurafinance/aura-contracts#84


The original report as published on Code4rena, by QuantumBrief. 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 contract required an exact equality between its asset balance and a user-supplied maximum amount, which an attacker can trivially change by sending a small amount of the asset.

Impact

Liquidity providers could be repeatedly blocked from using the function, causing a denial of service.

What the attacker needed

Ability to send a tiny amount of the asset; ability to front-run transactions

The fix

The exact-equality check should be removed or changed to require the balance to be greater than or equal to the requested maximum amount; the project resolved it in linked pull requests.

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 checked that its balance of a token exactly matched a number the user provided. Because anyone can send tokens to a contract, an attacker could send a tiny amount to make the numbers differ, so the user's transaction would always fail. This is a denial-of-service: blocking someone from using a function without stealing anything.

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 from Aura Finance 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.