Skip to content
Smart contracts Audit finding Advanced

Rewards of GiantMevAndFeesPool can be locked for all users

The GiantMevAndFeesPool contract's reward accounting can be manipulated by any user because the inherited ERC20 transfer function is not protected and triggers hooks that update reward state. An attacker could lock all rewards in the pool, making them inaccessible to other users.

clems4ever Follow

Originally disclosed on Code4rena

Submitted by clems4ever

https://github.com/code-423n4/2022-11-stakehouse/blob/4b6828e9c807f2f7c569e6d721ca1289f7cf7112/contracts/liquid-staking/GiantMevAndFeesPool.sol#L172 https://github.com/code-423n4/2022-11-stakehouse/blob/4b6828e9c807f2f7c569e6d721ca1289f7cf7112/contracts/liquid-staking/GiantLP.sol#L8

Any malicious user could make the rewards in GiantMevAndFeesPool inaccessible to all other users…

Proof of Concept

https://gist.github.com/clems4ever/9b05391cc2192c1b6e8178faa38dfe41

Copy the file in the test suite and run the test.

Tools Used

forge test

Recommended Mitigation Steps

Protect the inherited functions of the ERC20 tokens (GiantLP and LPToken) because transfer is not protected and can trigger the before and after hooks. There is the same issue with LPToken and StakingFundsVault.

vince0656 (Stakehouse) confirmed


The original report as published on Code4rena, by clems4ever. 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 ERC20 transfer function inherited by GiantLP is not protected and triggers before/after hooks that update reward state, allowing manipulation.

What the attacker needed

None

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.

This is a smart contract bug in a staking pool. The pool tracks rewards using a token, and that token's transfer function can be called by anyone to trigger internal updates that corrupt the reward accounting. As a result, a malicious user can make the rewards unclaimable for everyone.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by clems4ever

View all

8 more disclosed reports, best first.

More from LSD Network - Stakehouse contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.