Reproduced Exploit
Notional vault rewards — a grief pays the shareholder nothing
claimRewardTokens is permissionless. On an L2 the report's point is that calling it every block is cheap, so each call only observes a small reward balance. That balance is multiplied by 1e8 and divided by totalVaultShares. Below the share count, the division is zero, and the tokens that arrived ar…
Chain
Other
Category
logic
Date
Jun 2024
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: 35119-h-6-loss-of-rewards-due-to-continuous-griefing-attacks-on-l2. Standalone Foundry PoC and full write-up: 35119-h-6-loss-of-rewards-due-to-continuous-griefing-attacks-on-l2_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/logic/reward-calculation · vuln/arithmetic/precision-loss
Key info#
| Protocol | Notional Leveraged Vaults |
| Finding | Sherlock 2024-06 H-6, AuditVault 35119 |
| Vulnerable code | VaultRewarderLib._accumulateSecondaryRewardViaClaim |
| Harm | Honest shareholder receives 0 of 9900 reward units. The control pays them 9900. |
| Chain | local synthetic |
AuditVault taxonomy: lang/solidity · sector/staking · platform/sherlock · severity/high · genome: griefing · reward-accounting · dos-resistance
TL;DR#
claimRewardTokens is permissionless. On an L2 the report's point is that calling it every block is cheap, so each call only observes a small reward balance. That balance is multiplied by 1e8 and divided by totalVaultShares. Below the share count, the division is zero, and the tokens that arrived are not credited to anyone. Here each call is a local stand-in for one L2 reward message: the source releases 99 units. The vault has 100 shares. One hundred messages deliver 9900 units. The index stays 0. The shareholder's claim returns 0. A rewarder that keeps the division remainder credits the same 9900 and the shareholder receives all of it.
The vulnerable code#
The balance difference and the division are the two lines the report cites. PRECISION is Notional's INTERNAL_TOKEN_PRECISION of 1e8.
uint256 tokensClaimed = balanceAfter - balancesBefore;
accumulated += (tokensClaimed * PRECISION) / totalVaultSharesBefore; // @> VULN: drip rounds to zero
release() on the reward source is the L2 message. It transfers a fixed drip. Nothing in the attack waits for another chain or another block.
The control adds the undistributed remainder back in before the next division:
uint256 scaled = tokensClaimed * PRECISION + remainder;
uint256 delta = scaled / totalShares;
remainder = scaled % totalShares;
accumulated += delta;
Root cause#
The per-share index is an integer. 99 * 1e8 / 100e8 is 0. The function still accepts the tokens into the vault, then stores an index that did not move. Repeating the call does not repair it, because each drip is judged on its own. The shareholder's claim multiplies their shares by that index and also gets 0.
Preconditions#
One shareholder deposits 100 shares. Internal supply is 100 * 1e8. The reward source is funded with 9900 units and releases 99 per call. The griefer calls claimRewardTokens 100 times in the same transaction. No timestamp warp. The second chain is not required: the message is the local release call, and the bug is the division.
Attack walkthrough#
- Mint 9900 reward units to the source. Deposit 100 shares for the honest user.
- Call
claimRewardTokens100 times. Each call asks the source torelease99 units. tokensClaimedis 99. The index update divides99 * 1e8by100e8and adds 0.- After the loop the vault holds 9900 and
accumulatedis 0. claimfor the shareholder computesshares * 0 / 1e8and returns 0. Their token balance stays 0.
The control runs the same 100 releases through the remainder update. The index ends at 99. The shareholder's claim transfers 9900 and the vault balance ends at 0.
Diagrams#
Impact#
The shareholder receives 0 of the 9900 reward units their shares should have taken. The tokens are in the vault and the index that would pay them out was never increased. The griefer does not take the tokens. The loss is that the honest claim pays nothing. The remainder-tracking control, given the same drips, pays the shareholder the full 9900.
Remediation#
Do not drop the division remainder. Carry tokensClaimed * PRECISION % totalShares into the next call, which is what the control does, so a sequence of sub-threshold drips still sums to the right index. The report's other mitigation is to make claimRewardTokens permissioned so a keeper claims a balance large enough not to round away. Either change stops this user from being paid 0.
How to reproduce#
cd 35119-h-6-loss-of-rewards-due-to-continuous-griefing-attacks-on-l2_exp
forge test -vv
Sources#
- AuditVault finding: https://github.com/Auditware/AuditVault/blob/main/findings/35119-h-6-loss-of-rewards-due-to-continuous-griefing-attacks-on-l2.md
- Sherlock issue: https://github.com/sherlock-audit/2024-06-leveraged-vaults-judging/issues/61
- Vulnerable library: https://github.com/sherlock-audit/2024-06-leveraged-vaults/blob/main/leveraged-vaults-private/contracts/vaults/common/VaultRewarderLib.sol
- Contest: https://github.com/sherlock-audit/2024-06-leveraged-vaults-judging
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 35119-h-6-loss-of-rewards-due-to-continuous-griefing-attacks-on-l2_exp (evm-hack-registry mirror).
- AuditVault finding: 35119-h-6-loss-of-rewards-due-to-continuous-griefing-attacks-on-l2.
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.