Reproduced Exploit
Blur — StandardPolicyERC1155 hardcodes matched amount to 1
1. canMatchMakerAsk / canMatchMakerBid return 1 instead of order.amount. 2. BlurExchange uses that amount in _executeTokenTransfer / ERC1155 transfer. 3. Settlement still uses the full order.price. 4. HARM: buyer of amount=10 pays 100 WETH and receives only 1 ERC1155 unit.
Chain
Other
Category
logic
Date
Oct 2022
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: 42876-h-01-standardpolicyerc1155sol-returns-amount-1-instead-of-am. Standalone Foundry PoC and full write-up: 42876-h-01-standardpolicyerc1155sol-returns-amount-1-instead-of-am_exp in the
evm-hack-registrymirror.
Vulnerability classes: vuln/logic/wrong-condition · vuln/nft/amount-mismatch · genome: wrong-condition · direct-drain
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/42876-h-01-standardpolicyerc1155sol-returns-amount-1-instead-of-am_exp.sol.
AuditVault taxonomy: lang/solidity · platform/code4rena · has/github · has/poc · severity/high · sector/nft · sector/nft-marketplace · genome: wrong-condition · direct-drain · access-roles
Key info#
| Impact | HIGH — ERC1155 buyer pays full order price but receives only 1 unit |
| Protocol | Blur Exchange |
| Vulnerable code | StandardPolicyERC1155.canMatchMakerAsk — returns hardcoded 1 as amount |
| Bug class | Wrong match amount / under-delivery of ERC1155 |
| Finding | Code4rena 2022-10-blur · H-01 · #42876 |
| Report | code4rena.com/reports/2022-10-blur |
| Source | AuditVault |
| Status | Acknowledged (sponsor: ERC1155 policy not intended for production deploy). Reproduced as standalone local PoC. |
| Compiler | ^0.8.24 (PoC) |
TL;DR#
canMatchMakerAsk/canMatchMakerBidreturn1instead oforder.amount.BlurExchangeuses that amount in_executeTokenTransfer/ ERC1155 transfer.- Settlement still uses the full
order.price. - HARM: buyer of amount=10 pays 100 WETH and receives only 1 ERC1155 unit.
The vulnerable code#
return (
(makerAsk.side != takerBid.side) &&
/* … match checks … */
(makerAsk.price == takerBid.price),
makerAsk.price,
makerAsk.tokenId,
1, // @> VULN: hardcoded amount 1 instead of makerAsk.amount
AssetType.ERC1155
);
Fix: return makerAsk.amount (and enforce consistency with the taker order amount).
Root cause#
The ERC1155 matching policy was written as a transfer smoke-test and never wired the order’s amount field into the match result. Downstream execution trusts the policy’s amount for the NFT leg while still settling the quoted price.
Preconditions#
- Orders use
StandardPolicyERC1155asmatchingPolicy. - Sell/buy
amount > 1with a price set for that full amount.
Attack walkthrough#
- Seller lists 10 ERC1155 units at price 100 WETH; buyer matches amount=10.
- Policy returns amount
1. - Exchange pulls 100 WETH from buyer → seller, transfers 1 ERC1155 unit to buyer.
- HARM: buyer under-delivered by 9 units after paying full price.
Diagrams#
Impact#
Buyers of multi-unit ERC1155 orders overpay; sellers retain residual inventory after receiving the full listed price. Sponsor acknowledged the policy was not production-ready.
How to reproduce#
cd evm-hack-registry/42876-h-01-standardpolicyerc1155sol-returns-amount-1-instead-of-am_exp
forge test -vvv
Sources#
- AuditVault finding #42876
- Code4rena report 2022-10-blur
- Reduced from code-423n4/2022-10-blur
contracts/matchingPolicies/StandardPolicyERC1155.sol(contest main)
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 42876-h-01-standardpolicyerc1155sol-returns-amount-1-instead-of-am_exp (evm-hack-registry mirror).
- AuditVault finding: 42876-h-01-standardpolicyerc1155sol-returns-amount-1-instead-of-am.
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.