Reproduced Exploit
BOB Staking — instantWithdraw does not transfer amountForContract
1. Delegated stake lives in a DelegationSurrogate. 2. instantWithdraw pulls only _amountForUser from the surrogate. 3. _amountForContract (penalty) is never transferred back to BobStaking. 4. Penalty tokens freeze in the surrogate while rewardTokenBalance is increased on paper.
Chain
Other
Category
logic
Date
Oct 2025
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: 63717-c-01-instantwithdraw-does-not-transfer-amountforcontract-lo. Standalone Foundry PoC and full write-up: 63717-c-01-instantwithdraw-does-not-transfer-amountforcontract-lo_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/logic/frozen-funds · reward-accounting · temporary
Reproduction: a self-contained Foundry PoC that compiles & runs in an isolated project with only
forge-std— no fork, no RPC, noanvil_state. Full trace: output.txt. PoC: test/63717-c-01-instantwithdraw-does-not-transfer-amountforcontract-lo_exp.sol.
AuditVault taxonomy: severity/high · sector/staking · sector/governance · platform/pashov · frozen-funds · reward-accounting · reentrancy-guard · vote-delegation-loop
Key info#
| Impact | HIGH — early-withdraw penalty permanently stuck in surrogate; paper rewards inflated |
| Protocol | BOB Staking |
| Vulnerable code | BobStaking.instantWithdraw — missing transfer of _amountForContract from surrogate |
| Bug class | Incomplete token path when stake is delegated |
| Finding | Pashov BOB-Staking security review 2025-10-18 · #63717 |
| Report | Pashov BOB-Staking review |
| Source | AuditVault |
| Status | Audit finding — resolved per report. Reproduced as a reduced local synthetic. |
| Compiler | ^0.8.24 (PoC) |
TL;DR#
- Delegated stake lives in a
DelegationSurrogate. instantWithdrawpulls only_amountForUserfrom the surrogate._amountForContract(penalty) is never transferred back to BobStaking.- Penalty tokens freeze in the surrogate while
rewardTokenBalanceis increased on paper.
The vulnerable code#
if (stakers[_stakeMsgSender()].governanceDelegatee != address(0)) {
DelegationSurrogate surrogate = storedSurrogates[...];
IERC20(stakingToken).safeTransferFrom(address(surrogate), _receiver, _amountForUser);
// @> VULN: missing safeTransferFrom(surrogate, address(this), _amountForContract)
} else {
IERC20(stakingToken).safeTransfer(_receiver, _amountForUser);
}
Root cause#
The delegated and non-delegated withdraw paths are asymmetric: only the non-delegated path leaves the penalty in the staking contract naturally. The delegated path never repatriates it.
Preconditions#
- Staker has non-zero stake and a non-zero governance delegatee (tokens in surrogate).
- Instant withdraw allowed (not locked / no unbond started).
instantWithdrawalRate < 100so a non-zero penalty exists.
Attack walkthrough#
- Stake 1 BOB; whitelist and set a governance delegatee (tokens → surrogate).
- Call
instantWithdraw(50% rate). - User receives 0.5 BOB; 0.5 BOB remains in the surrogate forever.
- Staking contract balance unchanged;
rewardTokenBalanceclaims +0.5 on paper.
Diagrams#
Impact#
Penalty value that should fund rewards is permanently unrecoverable. Accounting overstates reward inventory, risking insolvency for later claimers.
Sources#
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 63717-c-01-instantwithdraw-does-not-transfer-amountforcontract-lo_exp (evm-hack-registry mirror).
- AuditVault finding: 63717-c-01-instantwithdraw-does-not-transfer-amountforcontract-lo.
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.