Reproduced Exploit

Regnum Aurum: a second notify in the first cycle replaces the reward rate (66178)

Before firstCycleStart, every notify sets rd.rate = amount / firstCycleDuration and returns. An honest notify of 1000e18 would pay 1e18 per second for 1000 seconds. A following notify of 1000 wei replaces that rate with 1. cyclePayout is then 1000 wei. The 1000e18 stays in the distributor. This pag…

May 2025•Ethereum•logic•3 min read

Loss

Distributor holds 1000e18 plus 1000 wei. The cycle pays only 1000 wei, so the 1000e18 is not distributed

Chain

Ethereum

Category

logic

Date

May 2025

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

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.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 66178-h-16-reward-rate-can-be-manipulated-in-first-cycle-pashov-au. Standalone Foundry PoC and full write-up: 66178-h-16-reward-rate-can-be-manipulated-in-first-cycle-pashov-au_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/reward-calculation

Key info#

FieldValue
LossDistributor holds 1000e18 plus 1000 wei. The cycle pays only 1000 wei, so the 1000e18 is not distributed
Vulnerable contractGaugeRewardsDistributor._handleRewardNotification
Attacker EOA0x1111111111111111111111111111111111111111
Attack contractExploit
Attack txExploit.run()
Chain / block / dateEthereum model · block 0 · 2025-05
Compilersolc 0.8.27, cancun
Bug classfirst-cycle rate is assigned, not accrued

TL;DR#

Before firstCycleStart, every notify sets rd.rate = amount / firstCycleDuration and returns. An honest notify of 1000e18 would pay 1e18 per second for 1000 seconds. A following notify of 1000 wei replaces that rate with 1. cyclePayout is then 1000 wei. The 1000e18 stays in the distributor. This page is AuditVault 66178.

The vulnerable code#

SOLIDITY
rd.rate = this.quoteRate(amount, firstCycleDuration);
// quoteRate returns amount / duration and does not add to the previous rate
// @> VULN: replaces the rate; prior rewards in this cycle are not accrued

Accrue inside the first cycle:

DIFF
- rd.rate = amount / firstCycleDuration;
+ rd.rate += amount / firstCycleDuration;

Root cause#

The first-cycle branch never adds the new amount onto rewards already notified. lastUpdateTime is also moved to now, so the previous rate is not settled before it is overwritten. The stored rate describes only the latest notify.

Preconditions#

  • block.timestamp is below firstCycleStart.
  • getFirstCycleDuration is 1000.
  • The honest amount is 1000e18 and the second amount is 1000 wei.

Attack walkthrough#

  1. The honest notify transfers 1000e18 into the distributor.
  2. quoteRate returns 1000e18 / 1000.
  3. A second notify transfers 1000 wei and quoteRate returns 1.
  4. rd.rate is 1. The earlier rate is gone.
  5. cyclePayout is 1 * 1000 = 1000 wei.
  6. Balance minus that payout is the original 1000e18.
  7. The control adds the two rates and the stored rate is 1e18 + 1.

Diagrams#

flowchart TD A["Honest notify of 1000e18"] --> B["Rate becomes amount over 1000 seconds"] B --> C["Dust notify of 1000 wei"] C --> D["VULN rate is replaced with 1"] D --> E["Cycle payout is 1000 wei"] E --> F["1000e18 stays in the distributor"] B --> G["Control adds the new rate"] G --> H["Control pays both notifies"]

Impact#

Stakers who were owed the 1000e18 notify earn 1000 wei over the whole first cycle. The tokens sit in the distributor and are not claimable at the honest rate. Any later notify before firstCycleStart can repeat the wipe. Finding 66178 is this same H-16.

How to reproduce#

BASH
cd 66178-h-16-reward-rate-can-be-manipulated-in-first-cycle-pashov-au_exp
forge test -vv

output.txt is the captured passing run. The control test checks the recommended fix.

Sources#


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

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.