Reproduced Exploit
HYBUX: A user unstaking through the router forfeits their entire accrued reward (1000 HYBUX): _un
Chain
Other
Category
untagged
Date
Jan 1970
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. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 63683-c-01-incorrect-reward-calculation-pashov-audit-group-none-hy. Standalone Foundry PoC and full write-up: 63683-c-01-incorrect-reward-calculation-pashov-audit-group-none-hy_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/locked-funds · vuln/reward-accounting
Reproduction: a faithful minimal reproduction of the vulnerable finding — the vulnerable function is reproduced verbatim (marked
@>) with faithful minimal doubles; local deploy, no fork.
Root cause#
A user unstaking through the router forfeits their entire accrued reward (1000 HYBUX): _unstakeNFTs claims for msg.sender (the router, which holds no position) then wipes the user's accrual, so the reward is never paid and becomes permanently unrecoverable.
}
function _unstakeNFTs(address _sender, uint256[] calldata _tokenIds) internal {
claimRewards(); // @> pays _claimRewards(msg.sender)=router, not the delegated _sender; user's accrued reward is then wiped below
// clear the user's position and reward checkpoint, and return the NFTs
rewards[_sender] = 0;
Why it's exploitable here#
A user unstaking through the router forfeits their entire accrued reward (1000 HYBUX): _unstakeNFTs claims for msg.sender (the router, which holds no position) then wipes the user's accrual, so the reward is never paid and becomes permanently unrecoverable.
Attack path#
Marked-line walkthrough (Playground)#
The EVM Playground pins each step to the exact executed source line in 0xce01759b82…:
- L113 — Public claimRewards entry point: Setup:
claimRewards()is the public claim function, but it always creditsmsg.sender, ignoring who actually owns the staked position. - L114 — Claim is credited to msg.sender:
_claimRewards(msg.sender)pays the immediate caller — fine for a direct user, but wrong when a router forwards the call for someone else. - L117 — Unstake knows the real owner:
_unstakeNFTsreceives_sender, the true position owner, and should settle rewards to that address before removing the stake. - L118 — Claim ignores _sender, uses caller: Root cause:
claimRewards()creditsmsg.sender(the router, no position) instead of_claimRewards(_sender), so the user's reward is never paid. - L128 — Correct claim-by-address helper:
_claimRewards(address)is the version that pays a named owner — the one unstake should have called, passing_sender. - L140 — Staking contract definition: Setup: the
NFTStakingFixedstaking contract that holds positions and accrues per-user rewards. - L154 — Wire up the router address: Setup: stores the router address; the router forwards user unstakes, which is exactly how
msg.senderdiverges from the real owner.
PoC#
Registry (Foundry, local deploy — verbatim vulnerable source + harm-asserting test + negative control):
cd 63683-c-01-incorrect-reward-calculation-pashov-audit-group-none-hy_exp
forge test -vvv
The browser Playground replays the same synthetic opcode-for-opcode and measures the harm: A user unstaking through the router forfeits their entire accrued reward (1000 HYBUX): _unstakeNFTs claims for msg.sender (the router, which. Both gates are green (registry forge test PASS + Playground _verify-poc VERDICT: PASS).
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 63683-c-01-incorrect-reward-calculation-pashov-audit-group-none-hy_exp (evm-hack-registry mirror).
- AuditVault finding: 63683-c-01-incorrect-reward-calculation-pashov-audit-group-none-hy.
- Upstream DeFiHackLabs PoC directory: src/test.
Alerts & third-party analyses
- DeFiHackLabs incident explorer: search "HYBUX: A user unstaking through the router forfeits their entire accrued reward (1000 HYBUX): _un".
- 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.