Skip to content
DoS Audit finding Intermediate

Malicious Stakers can grief Keepers

A staker can cause a keeper's top-up transaction to revert by deploying a contract at the payer address that reverts on receiving ether. This prevents the keeper from earning rewards and wastes their gas.

sseefried Follow

Originally disclosed on Code4rena

Submitted by sseefried

A Staker — that has their top-up position removed after execute is called by a Keeper — can always cause the transaction to revert. They can do this by deploying a smart contract to the payer address that has implemented a receive() function that calls revert(). The revert will be triggered by the following lines in execute

if (vars.removePosition) {
    gasBank.withdrawUnused(payer);
}

This will consume some gas from the keeper while preventing them accruing any rewards for performing the top-up action.

Proof of Concept

I have implemented a PoC in a fork of the contest repo. The attacker’s contract can be found here.

Recommend Mitigation Steps

To prevent this denial of service attack some way of blacklisting badly behaved Stakers should be added.

chase-manning (Backd) confirmed


The original report as published on Code4rena, by sseefried. 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 calls withdrawUnused(payer) without handling the case where the payer is a contract that reverts on receiving ether.

Impact

The keeper's transaction reverts, wasting gas and preventing reward accrual, but only for that specific top-up action.

What the attacker needed

A staker with a top-up position; the staker's payer address is a contract that reverts on…; a keeper calls execute

The fix

The contract should handle failed withdrawals gracefully, for example by using a pull-over-push pattern or a try-catch, and consider blacklisting malicious stakers.

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 keeper is a bot that performs actions for rewards. A staker can set their address to a smart contract that refuses to accept ether, so when the keeper tries to send leftover gas money back, the whole transaction fails. The keeper loses gas and gets no reward.

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 sseefried

View all

6 more disclosed reports, best first.

More from Backd Tokenomics 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.