Platform: Code4rena
Start Date: 05/10/2022
Pot Size: $50,000 USDC
Total HM: 2
Participants: 80
Period: 5 days
Judge: GalloDaSballo
Id: 168
League: ETH
Rank: 46/80
Findings: 1
Award: $114.82
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: dipp
Also found by: 0x4non, 0x52, 0xRobocop, 0xc0ffEE, 8olidity, Ch_301, Jeiwan, Junnon, KIntern_NA, Lambda, M4TZ1P, MiloTruck, Nyx, PaludoX0, Ruhum, RustyRabbit, Soosh, TomJ, Trust, arcoun, aviggiano, bardamu, cryptonue, csanuragjain, d3e4, enckrish, exd0tpy, hansfriese, jayphbee, joestakey, ladboy233, minhquanym, minhtrng, nicobevi, obront, polymorphism, rokinot, romand, rotcivegaf, rvierdiiev, saian, serial-coder, trustindistrust, zzykxx
114.8239 USDC - $114.82
https://github.com/code-423n4/2022-10-blur/blob/2fdaa6e13b544c8c11d1c022a575f16c3a72e3bf/contracts/matchingPolicies/StandardPolicyERC1155.sol#L33 https://github.com/code-423n4/2022-10-blur/blob/2fdaa6e13b544c8c11d1c022a575f16c3a72e3bf/contracts/matchingPolicies/StandardPolicyERC1155.sol#L59
Detailed description of the impact of this finding.
The impact of this vulnerability is that the buyer will get less ERC1155 tokens than he/she paid.
Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.
The ERC1155 standard is mix of erc20 and erc721 tokens, it means that you can have more than one instance of a given token id, for example you can own 5 instances of token id # n (for any n) on an ERC1155 collection.
The blur documentation says that the order struct accepts as parameter an "amount" so the contract can manage the ERC1155 tokens.
But at LoC 33 and LoC 59 at the StandardPolicyERC1155.sol contract, this "amount" parameter of the Order struct is not been used, instead a "1" is hardcoded.
So for example if seller want to sell 5 tokens of token id # n (for any n) of some collection, he will create a sell order with amount equal to 5 and the corresponding price for the 5. If the buyer want to accept the deal and submits valid buy order for the price asked by the seller, he will receive 1 token instead of 5.
This works the same if buyer is the "maker".
This can be easily tested with unit tests.
Manually reviewed
Used the amount specified in the order struct, instead of the hardcoded "1"
#0 - GalloDaSballo
2022-10-13T22:27:12Z