Reproduced Exploit
Regnum Aurum: a finished short stream skips 300 RWD of an older one
updateReward adds processed to lastProcessedDistributionIndex. processed counts every distribution in the window that is fully claimed, including ones that are not a contiguous prefix. At timestamp 1, a 4-epoch stream has vested 1 epoch and a later 1-epoch stream has vested all of it. The cursor mo…
Loss
300 RWD from distribution 0, epochs 2 through 4, can no longer be claimed
Chain
Ethereum
Category
logic
Date
Mar 2026
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: 66589-h-01-lastprocesseddistributionindex-can-skip-unfinished-olde. Standalone Foundry PoC and full write-up: 66589-h-01-lastprocesseddistributionindex-can-skip-unfinished-olde_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/logic/reward-calculation·vuln/logic/state-update
Key info#
| Field | Value |
|---|---|
| Loss | 300 RWD from distribution 0, epochs 2 through 4, can no longer be claimed |
| Vulnerable contract | RewardStream.updateReward |
| Attacker EOA | 0x766a64ea674c5c599a63cc61408e239c8e1f455a (the reward recipient) |
| Attack contract | Exploit |
| Attack tx | Exploit.run() |
| Chain / block / date | Ethereum model · block 0 · 2026-03 |
| Compiler | solc 0.8.27, cancun, via IR |
| Bug class | The cursor advances by a count of finished rows, not by a finished prefix |
TL;DR#
updateReward adds processed to lastProcessedDistributionIndex. processed counts every distribution in the window that is fully claimed, including ones that are not a contiguous prefix. At timestamp 1, a 4-epoch stream has vested 1 epoch and a later 1-epoch stream has vested all of it. The cursor moves from 0 to 1. A second update starts at 1, pays 0, and steps the cursor to 2. claimable is 0 while 300 RWD sits in the contract. The control advances only through the completed prefix, so the cursor stays on the unfinished stream.
Background#
Pashov Audit Group's 21 March 2026 Regnum Aurum review, finding H-01. Distributions have their own epochs and startTimestamp. A one-epoch stream can finish while an older four-epoch stream is still paying. Both updateReward and claimable start at lastProcessedDistributionIndex, so anything left behind that cursor is never read again.
The vulnerable code#
function updateReward(address user) external virtual returns (uint256 paid) {
uint256 startIndex = lastProcessedDistributionIndex[user];
uint256 processed;
(paid, processed) = _scan(user, startIndex);
// @> VULN: processed counts every finished distribution in the window, so a later 1-epoch stream advances the cursor past an older unfinished stream
lastProcessedDistributionIndex[user] = uint32(startIndex + processed);
}
Inside the scan, processed increments when epochsClaimed >= epochs, wherever that row sits in the window.
Root cause#
The cursor is defined as "everything before me is fully claimed." The update implements "add the number of fully claimed rows I saw." Those are equal only when the completed rows are a prefix.
Preconditions#
- Two distributions for the same user. The first has 4 epochs and 400 RWD. The second has 1 epoch and 100 RWD. Both start at timestamp 0.
- Block timestamp is 1, so the current epoch is 1. The short stream is finished. The long stream is 1 of 4.
- The stream contract holds the 500 RWD.
Attack walkthrough#
- The user queues the 4-epoch distribution, then the 1-epoch distribution.
- The first
updateRewardpays 100 RWD on index 0 and 100 RWD on index 1. - Index 0 is stored as 1 of 4 epochs. Index 1 is fully claimed.
processedis 1. - The cursor becomes 1. Index 0 is behind it with 300 RWD unpaid.
- The second
updateRewardstarts at 1, pays 0, and moves the cursor to 2. claimableis 0 andstrandedis 300 RWD, equal to the token balance left in the stream. The control leaves the cursor at 0.
Diagrams#
Impact#
The user is paid the 200 RWD that is vested now and permanently loses the remaining 300 RWD of the older distribution. Later updates and claimable both start at the cursor, so epochs 2, 3, and 4 of distribution 0 are never scanned.
Remediation#
Advance lastProcessedDistributionIndex only by the length of the contiguous completed prefix. Stop at the first distribution that is not fully claimed.
How to reproduce#
cd 66589-h-01-lastprocesseddistributionindex-can-skip-unfinished-olde_exp
forge test -vv
test_exploit_cursor_skips_unfinished_distribution asserts the cursor is 2, stranded is 300 RWD, and claimable is 0. test_control_cursor_stops_at_unfinished_prefix asserts the cursor stays 0 and stranded is 0. Captured output is output.txt.
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/66589-h-01-lastprocesseddistributionindex-can-skip-unfinished-olde.md
- Pashov report: https://github.com/pashov/audits/blob/master/team/md/RegnumAurum-security-review_2026-03-21.md
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 66589-h-01-lastprocesseddistributionindex-can-skip-unfinished-olde_exp (evm-hack-registry mirror).
- AuditVault finding: 66589-h-01-lastprocesseddistributionindex-can-skip-unfinished-olde.
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.