Skip to content
Smart contracts Audit finding Advanced

Theft of ETH of free floating SLOT holders

A reward-accounting bug in the Syndicate contract lets a malicious user overwrite rather than accumulate the accrued ETH per share, so they can claim ETH that belongs to free floating SLOT holders. The reporter states an attacker can steal all claimable ETH of those holders.

clems4ever Follow with HE1M

Originally disclosed on Code4rena

Submitted by clems4ever, also found by HE1M

https://github.com/code-423n4/2022-11-stakehouse/blob/39a3a84615725b7b2ce296861352117793e4c853/contracts/syndicate/Syndicate.sol#L369 https://github.com/code-423n4/2022-11-stakehouse/blob/39a3a84615725b7b2ce296861352117793e4c853/contracts/syndicate/Syndicate.sol#L668 https://github.com/code-423n4/2022-11-stakehouse/blob/39a3a84615725b7b2ce296861352117793e4c853/contracts/syndicate/Syndicate.sol#L228

A malicious user can steal all claimable ETH belonging to free floating SLOT holders…

Proof of Concept

https://gist.github.com/clems4ever/f1149743897b2620eab0734f88208603

Run it in the test suite with forge

Tools Used

Manual review / forge

Recommended Mitigation Steps

+= operator instead of = in https://github.com/code-423n4/2022-11-stakehouse/blob/39a3a84615725b7b2ce296861352117793e4c853/contracts/syndicate/Syndicate.sol#L228 ?

The logic for keeping the rewards up-to-date is also quite complex in my opinion. The main thing that triggered it for me was the lazy call to updateAccruedETHPerShares. Why not keep the state updated after each operation instead?

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 an assignment operator overwrites the accrued ETH-per-share value instead of adding to it, combined with lazy updates of that state.

Impact

An attacker could take all claimable ETH belonging to free floating SLOT holders.

What the attacker needed

A position in the Syndicate contract; claimable ETH held for free floating SLOT holders

The fix

The reporter suggests using an additive assignment for the accrued value and keeping state updated after each operation rather than lazily; the project confirmed the issue.

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 keeps track of how much reward money each participant has earned. Here the code replaced the running total with a new value instead of adding to it, so earlier earnings were wiped out and could be taken by someone else. The result is that honest holders lose money they had already earned.

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.