Reproduced Exploit
VaderPoolV2 `mintSynth` mints a victim's deposit to an attacker (arbitrary `from`)
Chain
Other
Category
access-control
Date
Nov 2021
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: 42335-h-13-anyone-can-arbitrarily-mint-synthetic-assets-in-vaderpo. Standalone Foundry PoC and full write-up: 42335-h-13-anyone-can-arbitrarily-mint-synthetic-assets-in-vaderpo_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/access-control/missing-auth · vuln/defi/frontrun · fake-account-substitution
Reproduction: the test deploys the REAL, unmodified audited Vader dex-v2 contracts (
VaderPoolV2,BasePoolV2,SynthFactory,Synth,LPWrapper,LPToken,VaderMath) vendored undersrc/vader/and runs the actualmintSynthexploit end to end. Only the opaque native/foreign ERC20s are minimal real tokens.
Root cause#
VaderPoolV2.mintSynth is external and permissionless, yet it takes a caller-supplied from and pulls the native deposit from it:
function mintSynth(IERC20 foreignAsset, uint256 nativeDeposit, address from, address to)
external override nonReentrant supportedToken(foreignAsset) returns (uint256 amountSynth)
{
nativeAsset.safeTransferFrom(from, address(this), nativeDeposit); // @> pulls from an ATTACKER-chosen address
...
synth.mint(to, amountSynth); // @> mints the synth to an ATTACKER-chosen address
}
The protocol intends users to interact through the router, so a user first approves the pool and then calls mintSynth for themselves. Because from is unauthenticated, any account can watch the mempool for a pool approval and front-run the victim, calling mintSynth(foreignAsset, nativeDeposit, from = victim, to = attacker). The victim's approved native is spent and the resulting synth is minted to the attacker. The fix (per the finding) is to remove from and transfer from msg.sender.
The exact audited source is vendored at src/vader/contracts/dex-v2/pool/VaderPoolV2.sol (mintSynth, L126-167).
Exploit walkthrough (real numbers)#
- A legitimate LP seeds the
USDCpair with 100 native / 100 foreign via the realmintFungible, so the synth price is non-zero. - The victim holds 10 VADER and
approves the pool (intending to mint a synth for themselves). - The attacker calls
mintSynth(USDC, 10e18, from = victim, to = attacker). - Result: the victim's 10 VADER is pulled into the pool and 8.264 synth (
calculateSwap(10, 100, 100)) is minted to the attacker for free. The victim ends with 0 native and 0 synth.
Reproduction#
_shared/run-poc/run_poc.sh 42335-h-13-anyone-can-arbitrarily-mint-synthetic-assets-in-vaderpo_exp -vvvvv
Expected: 1 passed. The assertions in test/42335-h-13-anyone-can-arbitrarily-mint-synthetic-assets-in-vaderpo_exp.sol verify the victim's native drops to 0 and the attacker receives the full minted synth amount.
Sources#
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 42335-h-13-anyone-can-arbitrarily-mint-synthetic-assets-in-vaderpo_exp (evm-hack-registry mirror).
- AuditVault finding: 42335-h-13-anyone-can-arbitrarily-mint-synthetic-assets-in-vaderpo.
- Upstream DeFiHackLabs PoC directory: src/test.
Alerts & third-party analyses
- DeFiHackLabs incident explorer: search "VaderPoolV2
mintSynthmints a victim's deposit to an attacker (arbitraryfrom)". - 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.