# Trusted default key in accounting

Whitelists or defaults trusting public keys, test accounts, or predictable RNG in reward and access logic

_Area: DeFi accounting and math bugs. Seen in 2 disclosed reports; latest 2026-10-18. Updated 2026-10-29._

## How it works
Accounting trusts an identity or credential that was never validated as secret or unique. A whitelist entry, a default account, or a default RNG is assumed to be a legitimate, private, unpredictable authority. When that assumption breaks — the key is public, the account is a well-known test key, or the RNG is seeded from `Math.random` and wall clock — an attacker can act as that trusted party and the bookkeeping pays them as if they were legitimate.

## Where it shows up
- Allowlists/whitelists containing well-known test keys (Hardhat/Anvil account #0, `0xf39F...2266`) or any address whose private key is published [E2](https://bugbountylibrary.com/r/dhl%3A20261018-alpscon.md)
- Privileged EOAs that can be impersonated via EIP-7702 delegation [E2](https://bugbountylibrary.com/r/dhl%3A20261018-alpscon.md)
- Versioned `migrate()` flows that import prior balances and then pay rewards against accumulated `profitPerShare` [E2](https://bugbountylibrary.com/r/dhl%3A20261018-alpscon.md)
- Staking deposit flows where validator registration is first-deposit-wins and withdrawal credentials bind at registration [E1](https://bugbountylibrary.com/r/blog%3Aimmunefi-com-blog-bug-fix-reviews-rocketpool-and-lido-frontrunning-bugfix-review.md)
- Crypto libraries ported from browser to Node where the CSPRNG branch is gated on `window.crypto` rather than `globalThis.crypto` [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-vh45-f885-3848.md)

## How to review
The invariant: every identity or random value used in accounting must be secret, unique, and unpredictable, and must be validated at the point of use. Check each whitelist entry against known public/test keys. Confirm privileged accounts cannot be impersonated. For deposit flows, verify withdrawal credentials are bound to the depositor and that a later deposit cannot silently increase an attacker-registered validator's balance [E1](https://bugbountylibrary.com/r/blog%3Aimmunefi-com-blog-bug-fix-reviews-rocketpool-and-lido-frontrunning-bugfix-review.md). For RNG, confirm the secure branch actually executes in the target runtime (Node has `globalThis.crypto`, not `window`) [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-vh45-f885-3848.md). For `migrate()`, confirm imported balances are not double-counted against reward accumulators [E2](https://bugbountylibrary.com/r/dhl%3A20261018-alpscon.md).

## Variants seen
- Public test key on a reward whitelist plus EIP-7702 impersonation [E2](https://bugbountylibrary.com/r/dhl%3A20261018-alpscon.md)
- First-deposit-wins validator registration capturing pool funds [E1](https://bugbountylibrary.com/r/blog%3Aimmunefi-com-blog-bug-fix-reviews-rocketpool-and-lido-frontrunning-bugfix-review.md)
- Default RNG seeded from `Math.random` and wall clock in Node [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-vh45-f885-3848.md)

## Why fixes fail
E2 shows versioned hubs where `migrate()` imports balances and `claimServiceResults()` pays them against accumulated `profitPerShare`, so each new version re-opens the over-claim unless the accounting is fixed, not just the whitelist.

## Impact and severity
Direct fund loss: ~152.8K USDC drained [E2](https://bugbountylibrary.com/r/dhl%3A20261018-alpscon.md); pool deposit funds captured [E1](https://bugbountylibrary.com/r/blog%3Aimmunefi-com-blog-bug-fix-reviews-rocketpool-and-lido-frontrunning-bugfix-review.md); predictable private keys and signing scalars [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-vh45-f885-3848.md). Severity is high because the trusted credential is public or guessable, and versioned migration flows amplify repeated over-claims [E2](https://bugbountylibrary.com/r/dhl%3A20261018-alpscon.md).

## Evidence
- E1: https://bugbountylibrary.com/r/blog%3Aimmunefi-com-blog-bug-fix-reviews-rocketpool-and-lido-frontrunning-bugfix-review.md
- E2: https://bugbountylibrary.com/r/dhl%3A20261018-alpscon.md
- E3: https://bugbountylibrary.com/r/ghsa%3AGHSA-vh45-f885-3848.md
