Reproduced Exploit
Peapods — self-lending rewards are swapped to the borrow token and never become fTokens
For a self-lending pod the paired LP token is an fToken. IS_PAIRED_LENDING_PAIR therefore swaps rewards into the lending pair's borrow token, with the intention of depositing that token for fTokens.
Chain
Other
Category
logic
Date
Nov 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. Query opens a search over the trace: previous and next writes, balance changes and calls, breakpoints, and a diff of everything that changed between two steps. No backend, no live RPC.
Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 45984-c-02-for-self-lending-pairs-rewards-will-be-stuck-pashov-aud. Standalone Foundry PoC and full write-up: 45984-c-02-for-self-lending-pairs-rewards-will-be-stuck-pashov-aud_exp in the
evm-hack-registrymirror.
Vulnerability classes:
vuln/logic/reward-calculation·vuln/dos/frozen-funds
Reproduction: a self-contained Foundry PoC that compiles and runs offline with only
forge-std— no fork and no RPC. Trace: output.txt. PoC: test/45984-c-02-for-self-lending-pairs-rewards-will-be-stuck-pashov-aud_exp.sol.
Key info#
| Impact | HIGH — 1,000 reward tokens become borrow-token underlying and stay stuck; stakers receive 0 pod LP |
| Protocol | Peapods AutoCompoundingPodLp._tokenToPairedLpToken |
| Vulnerable code | the token != lpRewardsToken branch returns the swap output and does not deposit into the lending pair |
| Bug class | Self-lending compounder never converts underlying into the paired fToken |
| Finding | Pashov C-02 — Peapods, 16 Nov 2024 · id 45984 |
| Report | Peapods security review |
| Source | AuditVault finding |
| Compiler | solc 0.8.27, cancun, via IR |
TL;DR#
For a self-lending pod the paired LP token is an fToken. IS_PAIRED_LENDING_PAIR therefore swaps rewards into the lending pair's borrow token, with the intention of depositing that token for fTokens.
That deposit happens only when the reward token equals lpRewardsToken. When it does not, _tokenToPairedLpToken returns the underlying amount. The later swap wants fTokens, reverts, and is swallowed by try/catch. The underlying sits in the compounder. compounded stays 0.
The fixed path deposits the underlying into the pair and mints 1,000 pod LP to the staker.
The vulnerable code#
if (address(token) != address(lpRewardsToken)) {
amountOut = _swap(token, swapOutput, amountIn);
return amountOut; // @> VULN: underlying is returned, never deposited for fTokens
}
if (address(token) != address(lpRewardsToken)) {
amountOut = _swap(token, swapOutput, amountIn);
- return amountOut;
+ swapOutput.approve(address(pairedLp), amountOut);
+ return pairedLp.deposit(amountOut, address(this));
}
Attack walkthrough#
- The compounder holds 1,000 reward tokens. The reward token is not the pod LP reward token, and the pod is self-lending.
processRewardsswaps those tokens 1:1 into the borrow token.- The function returns that amount instead of calling
deposit. _swapPairedToPodrequires an fToken balance, reverts, and the try/catch keeps going.- The compounder holds 1,000 underlying, 0 fToken, and stakers hold 0 pod LP.
Diagrams#
Impact#
Reward value that should have compounded into pod LP is frozen as the lending pair's underlying inside the aspTKN-style compounder. Stakers receive none of it. A later redemption of the pod does not see those tokens.
Sources#
- AuditVault 45984
- Pashov Peapods review, 2024-11-16
- Blamed function:
AutoCompoundingPodLp._tokenToPairedLpToken, as quoted in that review
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 45984-c-02-for-self-lending-pairs-rewards-will-be-stuck-pashov-aud_exp (evm-hack-registry mirror).
- AuditVault finding: 45984-c-02-for-self-lending-pairs-rewards-will-be-stuck-pashov-aud.
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.