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: 24/80
Findings: 2
Award: $165.30
🌟 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
The StandardPolicyERC1155 policy always set the amount to 1 even though the Order has amount>1. This can lead to buyer not receiving what he has paid to seller.
function canMatchMakerAsk(Order calldata makerAsk, Order calldata takerBid) external pure override returns ( bool, uint256, uint256, uint256, AssetType ) { return ( (makerAsk.side != takerBid.side) && (makerAsk.paymentToken == takerBid.paymentToken) && (makerAsk.collection == takerBid.collection) && (makerAsk.tokenId == takerBid.tokenId) && (makerAsk.matchingPolicy == takerBid.matchingPolicy) && (makerAsk.price == takerBid.price), makerAsk.price, makerAsk.tokenId, 1, AssetType.ERC1155 ); }
OR
OR
#0 - GalloDaSballo
2022-10-13T22:27:22Z
🌟 Selected for report: 0x4non
Also found by: 0x1f8b, 0xNazgul, 0xSmartContract, Deivitto, IllIllI, Lambda, RaymondFam, Rolezn, RustyRabbit, Trust, arcoun, bin2chen, brgltd, csanuragjain, d3e4, enckrish, exd0tpy, ladboy233, nicobevi, rbserver, rotcivegaf, simon135, zzykxx
50.4817 USDC - $50.48
Contract: https://github.com/code-423n4/2022-10-blur/blob/main/contracts/lib/MerkleVerifier.sol#L33
Issue: _verifyProof allows empty proofs and in that case it expects the leaf to equal the root, because no hashing and iteration is taking place.
Recommendation: Disallow empty proofs.
Contract: https://github.com/code-423n4/2022-10-blur/blob/main/contracts/BlurExchange.sol#L283
Issue: In _canSettleOrder function, Order should allowed to be settled even when block.timestamp = expirationTime or listingTime = block.timestamp , but seems like contract has missed these conditions
Recommendation: Revise the conditions like below:
return (listingTime <= block.timestamp) && (expirationTime == 0 || block.timestamp <= expirationTime);
Contract: https://github.com/code-423n4/2022-10-blur/blob/main/contracts/ExecutionDelegate.sol#L125
Issue: In transferERC20 function, It seems the transfer of ERC20 token is made making use of transferFrom function instead of safeTransferFrom. So, even if transfer fails contract will have no way to know the same and receiver will lose the funds
Recommendation: Kindly use safeTransferFrom function instead of transferFrom
Contract: https://github.com/code-423n4/2022-10-blur/blob/main/contracts/BlurExchange.sol#L181
Issue: If Seller wants to cancel an Order A due to potential loss in trade, Buyer who is watching mempool can simply frontrun this call by calling the execute function with higher gas fees. Even though Seller did not wanted to execute this transaction, buyer will still make it happen
Recommendation: Use flashbots which will hide cancelOrder from mempool
Contract: https://github.com/code-423n4/2022-10-blur/blob/main/contracts/BlurExchange.sol#L181
Issue:
Recommendation: Allow user to jump to a required nonce value directly
Contract: https://github.com/code-423n4/2022-10-blur/blob/main/contracts/BlurExchange.sol#L145
Issue: It is not checked whether the current order has price set as 0. If 0 price is set then buyer is paying nothing and obtaining the nft from seller which is incorrect
Recommendation: Add a new check
require(price>0, "Incorrect price");
Contract: https://github.com/code-423n4/2022-10-blur/blob/main/contracts/BlurExchange.sol#L365
Issue: In _validateUserAuthorization function, It is not checked whether _recover returns 0 address. If trader is also 0 address then user authorization is success and user can create an order on behalf of 0 address
Recommendation: Revert if _recover returns 0 address
Contract: https://github.com/code-423n4/2022-10-blur/blob/main/contracts/BlurExchange.sol#L134
Issue:
Recommendation:
#0 - GalloDaSballo
2022-10-22T22:22:24Z
##Â _verifyProof allows empty proofs NC in lack of showing any risk, the hash of 0x0 is non-zero
L
TODO - M-01
Valid consideration but I'm not awarding as I don't believe it's a valid vulnerability and I cannot imagine a way to avoid this that doesn't increase risk
Don't think this is intended in any way as your only valid orders are at nonce X, signing at nonce+1k means the orders are still invalid
R
R
L
#1 - GalloDaSballo
2022-11-07T20:20:20Z
2L 2R 1NC