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: 7/80
Findings: 3
Award: $2,603.11
🌟 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/main/contracts/matchingPolicies/StandardPolicyERC1155.sol#L33 https://github.com/code-423n4/2022-10-blur/blob/main/contracts/matchingPolicies/StandardPolicyERC1155.sol#L59 https://github.com/code-423n4/2022-10-blur/blob/main/contracts/lib/OrderStructs.sol#L19
Blur Exchange supports buying or selling several ERC1155 tokens by specifying the amount
value in an Order
structure. This is correctly implemented in the BlurExchange
contract but not in the StandardPolicyERC1155
contract which fails to validate the amount
and will always return 1
as the amount of the token.
A buyer wanted to buy several tokens will pay the full price and only get one token.
amount = 10
and price = 10 ether
amount
can be of any value in the order)execute()
with the two ordersThe amount
value must be checked (both orders must have the same amount) and returns inside canMatchMakerAsk
and canMatchMakerBid
.
#0 - GalloDaSballo
2022-10-13T22:27:14Z
🌟 Selected for report: Soosh
Also found by: 0x1f8b, 0x4non, 0xc0ffEE, RaymondFam, Ruhum, RustyRabbit, Trust, arcoun, cccz, d3e4, minhtrng, rotcivegaf, saian, sakshamguruji
https://github.com/code-423n4/2022-10-blur/blob/main/contracts/ExecutionDelegate.sol#L36-L39
The owner of the ExecutionDelegate contract can call approveContract()
to add a new address allowed to transfer ERC20/ERC721/ERC1155 tokens.
As the BlurEchange
contract is already upgradeable, there is no need to add any other addresses after the contract has been created/initialized.
If there are very valuable approvals on ExecutionDelegate
or if the private key of the owner is compromised, this is a potential scenario.
approve()
on the WETH
contract to approve the transfer by the ExecutionDelegate
contractapproveContract())
and steal the 10000 WETH (and all other approved tokens) by calling transferERC20()
(or the other transfer functions).Remove Ownable
, contracts
, approveContract()
and denyContract()
. Add an imutable exchangeAddress
address as the only allowed address to transfer tokens, and only set it in the constructor or initializer.
#0 - GalloDaSballo
2022-10-10T23:10:36Z
The finding looks valid Admin Privilege, historically Med
#1 - GalloDaSballo
2022-10-27T15:45:35Z
R
#2 - GalloDaSballo
2022-11-15T23:35:28Z
Dup of #235
🌟 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
https://github.com/code-423n4/2022-10-blur/blob/main/contracts/BlurExchange.sol#L451-L453
The execute()
function is payable to allow a buyer to directly provide Ether as payment. If a user does a mistake and send Ether while this is not expected, the Ether will be locked in the contract and not refunded.
paymentToken=WETH
ExecutionDelegate
contract for WETH or already has an old approvalThe _executeFundsTransfer
function must ensure that msg.value
is zero when a direct payment is not expected.
#0 - GalloDaSballo
2022-10-13T21:11:49Z
Dup of #634
#1 - GalloDaSballo
2022-11-09T13:42:44Z
L