Reproduced Exploit
FuroStream — a top-up is paid to the recipient and then withdrawn again
updateStream sends the top-up tokens to the stream recipient and still adds the returned shares to the stream. The recipient already has the tokens. withdraw then pays those shares out of the contract, which is holding another depositor's balance. A 400 top-up moves 400 from that escrow to the reci…
Chain
Ethereum
Category
logic
Date
May 2022
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 19585-stream-updates-are-paid-directly-to-the-recipient-sigmaprime. Standalone Foundry PoC and full write-up: 19585-stream-updates-are-paid-directly-to-the-recipient-sigmaprime_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/logic/incorrect-state-transition·vuln/logic/missing-validation
Key info#
| Protocol | Sushi FuroStream |
| Finding | Sigma Prime, AuditVault 19585 |
| Vulnerable code | updateStream deposits to recipient |
| Harm | The recipient withdraws 400 of another depositor's escrow. The control leaves that escrow at 1000. |
| Chain | local synthetic |
TL;DR#
updateStream sends the top-up tokens to the stream recipient and still adds the returned shares to the stream. The recipient already has the tokens. withdraw then pays those shares out of the contract, which is holding another depositor's balance. A 400 top-up moves 400 from that escrow to the recipient. Depositing the top-up to the stream contract, which is the fix, returns only the sender's own 400 and leaves the other 1000 in place.
The vulnerable code#
depositedShares = _depositToken(
stream.token,
stream.sender,
recipient, // should be address(this)
topUpAmount,
fromBentoBox
);
The deployed fix passes address(this).
Root cause#
The deposit destination and the share accounting disagree. Shares are an obligation of the contract, but the tokens were delivered to the recipient.
Preconditions#
The stream contract already holds 1000 from another depositor. The caller is the stream recipient and tops up by 400. The top-up transfer is from the caller to the caller, so it does not increase their balance. The following withdraw does.
Attack walkthrough#
updateStream(400)calls_depositTokenwith the recipient.- The function still increases
depositedSharesby 400. withdrawtransfers 400 from the contract to the recipient.- The recipient's balance rises by 400. The contract is left holding 600 of the original 1000.
- The control deposits the 400 into the contract and withdraws it back. The caller's balance is unchanged by that pair, and the other depositor's 1000 is intact.
Diagrams#
Impact#
The other depositor's escrow falls from 1000 to 600. The recipient gains 400 that the top-up never added to the contract. The control path does not touch that 1000.
Remediation#
Pass address(this) as the deposit recipient so the top-up tokens and the credited shares stay in the same place.
How to reproduce#
cd 19585-stream-updates-are-paid-directly-to-the-recipient-sigmaprime_exp
forge test -vv
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/19585-stream-updates-are-paid-directly-to-the-recipient-sigmaprime.md
- Sigma Prime report: https://github.com/sigp/public-audits/blob/master/sushi/auction-maker-furo/review.pdf
- Fixed
updateStreamdeposits toaddress(this): https://etherscan.io/address/0x4ab2fc6e258a0ca7175d05ff10c5cf798a672cae#code
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 19585-stream-updates-are-paid-directly-to-the-recipient-sigmaprime_exp (evm-hack-registry mirror).
- AuditVault finding: 19585-stream-updates-are-paid-directly-to-the-recipient-sigmaprime.
Alerts & third-party analyses
These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.