Reproduced Exploit

Hyperstable — RewardsDistributor.claim reverts once a ve lock expires and the reward stays in the distributor

May 2025•Other•dos•2 min read

Chain

Other

Category

dos

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. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 55694-h-03-rewarddistributorclaim-will-revert-for-tokens-with-expi. Standalone Foundry PoC and full write-up: 55694-h-03-rewarddistributorclaim-will-revert-for-tokens-with-expi_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/dos/frozen-funds · vuln/logic/incorrect-state-transition · vuln/logic/missing-check

Reproduction: Local Foundry reproduction of the verbatim claim / deposit_for pair. No fork. Trace: output.txt.

Root cause#

RewardsDistributor.claim always forwards a non-zero reward into the voting escrow with deposit_for. vePeg.deposit_for reverts when locked.end is not strictly after block.timestamp ("Cannot add to expired lock. Withdraw"). increase_unlock_time uses the same require, so the lock cannot be extended after expiry. The claim reverts and the PEG stays in the distributor.

SOLIDITY
if (amount != 0) {
    // @> VULN:
    IVotingEscrow(voting_escrow).deposit_for(_tokenId, amount);
    token_last_balance -= amount;
}

Attack path#

flowchart TD A["Two locks are funded with 1000 PEG each"] --> B["Expired lock end equals this block timestamp"] B --> C["claim loads that 1000 PEG"] C --> D["claim calls deposit_for"] D --> E["ve rejects the expired lock"] E --> F["1000 PEG remains in the distributor"] F --> G["The still-live lock claims and compounds"]

PoC#

One transaction. The expired lock's claim is a low-level call and reverts. The live lock's claim succeeds and compounds 1000 PEG into the escrow. The distributor's PEG balance is the expired 1000.

The fixed distributor pays an expired lock by transferring PEG to the owner. That control leaves the distributor at 0.

BASH
cd 55694-h-03-rewarddistributorclaim-will-revert-for-tokens-with-expi_exp
forge test -vv

Remediation#

If locked.end <= block.timestamp, transfer the reward to the lock owner instead of calling deposit_for. Hyperstable did this in commit 3012a71.

References#


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.