Reproduced Exploit
Hinkal: moving a nullifier into tokenIds duplicates a 1,000,001 USDC note
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: 60148-the-protocol-can-be-drained-through-commitment-duplication-q. Standalone Foundry PoC and full write-up: 60148-the-protocol-can-be-drained-through-commitment-duplication-q_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/logic/missing-check · vuln/logic/state-update
formBasicInput appends tokenIds and then inputNullifiers. A transfer proof whose public input is the single nullifier 7 still verifies if that nullifier is placed in tokenIds and inputNullifiers is empty. insertNullifiers then writes nothing. Alice's old 1,000,001 USDC commitment stays spendable next to a new 1,000,000 USDC commitment. She withdraws both. The pool also held another depositor's 1,000,000 USDC, so she leaves with 2,000,001.
require(verifyProof(input), "proof");
insertNullifiers(inputNullifiers); // empty, so nullifier 7 is not spent
commitments[newNullifiers[i]] = Commitment(newOwners[i], newAmounts[i], false); // @> VULN
Diagrams#
Impact#
Alice's balance is 2,000,001 USDC after a 1,000,001 deposit. The extra 1,000,000 is the other depositor's USDC. The pool is empty and Bob's 1 USDC note is unbacked. The fixed path requires the verified input itself to be the nullifier list, so the swapped call reverts and the other 1,000,000 USDC stays in the contract.
PoC#
cd 60148-the-protocol-can-be-drained-through-commitment-duplication-q_exp
forge test -vv
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 60148-the-protocol-can-be-drained-through-commitment-duplication-q_exp (evm-hack-registry mirror).
- AuditVault finding: 60148-the-protocol-can-be-drained-through-commitment-duplication-q.
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.