Platform: Code4rena
Start Date: 04/11/2022
Pot Size: $42,500 USDC
Total HM: 9
Participants: 88
Period: 4 days
Judge: 0xean
Total Solo HM: 2
Id: 180
League: ETH
Rank: 47/88
Findings: 2
Award: $49.89
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: Trust
Also found by: 0x1f8b, 0xdapper, HE1M, KIntern_NA, Lambda, Picodes, RaymondFam, RedOneN, TomJ, V_B, __141345__, c7e7eff, chaduke, codexploder, corerouter, cryptonue, fs0c, gz627, hihen, joestakey, ktg, ladboy233, minhtrng, rvierdiiev, simon135, skyle, slowmoses, wagmi, yixxas
5.604 USDC - $5.60
https://github.com/code-423n4/2022-11-size/blob/main/src/SizeSealed.sol#L157-L159
SIZE contract does not prevent the same bidder to submit multiple bids from the same address or from multiple different addresses. However, to prevent DOS attacks, SIZE introduces a condition on the total number of bids that could take place for an auction (max 1000 bids). Although such condition prevents DOS and allows the "Finalize()" function to have a "finite" for loop, it opens the door to another another risk. By limiting the total number of bid to 1000, it gives the possibility to a malicious bidder to perform 1000 transactions at the "minimumBidQuote" under three scenarios :
Note that that such attack could very easily take place if the "minimumBidQuote" value is low. E.g. if we assume USDC being the "QuoteToken" and a minimumBidQuote of 1 USDC, any bidder with a balance of at least 1000USDC could perform the attack.
As a result, the protocol deviates from its main objective since :
See link provided above.
Manual audit .
Possibilities to mitigate this risk includes :
#0 - c4-judge
2022-11-09T15:35:24Z
0xean marked the issue as duplicate
#1 - c4-judge
2022-12-06T00:22:10Z
0xean marked the issue as satisfactory
#2 - c4-judge
2022-12-06T00:31:02Z
0xean changed the severity to 2 (Med Risk)
🌟 Selected for report: 0x1f8b
Also found by: 0xSmartContract, 0xc0ffEE, Aymen0909, B2, Deivitto, Josiah, KingNFT, Rahoz, RaymondFam, RedOneN, ReyAdmirado, Trust, ajtra, aviggiano, brgltd, c7e7eff, cryptonue, ctf_sec, delfin454000, djxploit, lukris02, peanuts, rvierdiiev, shark, simon135, slowmoses, tnevler, trustindistrust
44.2869 USDC - $44.29
Functions in solmate's SafeTransferLib library do not check whether a token has code at all. This responsibility is delegated to the caller. As a call to an address with no code will be a no-op, since low-level calls to non-contracts always return true, a transfer of tokens using solmate's SafeTransferLib will succeed if the token does not have any code. Therefore, it is recommended to verify that a contract exists before using any SafeTransferLib functions.
In the case of SIZE, this check is indirectly performed for the "baseToken" by verifying that the contract balance before and after transfer is coherent. However, no check is performed for the "quoteToken". As a result, Seller might accidentally provide a non-existing address. As a result, he will create an auction and pay GAS for an auction that no one Wille participate in.
During the life of an auction, a seller is allowed to cancel an auction as long as the auction is not over (block.timestamp < EndDate). If so, the contract logic set the EndDate to "infinite" so that the auction never end. Doing so does not induce any trouble in term of fund retrieve (bidders and seller are able to claim back their fund) but it does not prevent new bidders to bid on this canceled auction and pay GAS.
SIZE contract provides the seller with the possibility to include a vesting period. However, there is no limit set on the vesting end date. As a result, a seller could set an infinite vesting end date. A bidder that did not pay attention at the vesting time will only be able to claim the cliff amount.
Even assembly can benefit from using readable constants instead of hex/numeric literals.
File : SizeSealed.sol
SizeSealed.sol#L35 SizeSealed.sol#L37 SizeSealed.sol#L241 SizeSealed.sol#L249 SizeSealed.sol#L266 SizeSealed.sol#L426
Block timestamps have historically been used for a variety of applications, such as entropy for random numbers (see the Entropy Illusion for further details), locking funds for periods of time, and various state-changing conditional statements that are time-dependent. Miners have the ability to adjust timestamps slightly, which can prove to be dangerous if block timestamps are used incorrectly in smart contracts.
File : CommonTokenMath.sol
CommonTokenMath.sol#L40 CommonTokenMath.sol#L41
File : SizeSealed.sol
SizeSealed.sol#L29 SizeSealed.sol#L31 SizeSealed.sol#L35 SizeSealed.sol#L37 SizeSealed.sol#L60 SizeSealed.sol#L425 SizeSealed.sol#L426 SizeSealed.sol#L460
Details about some important parameters would be useful :
https://github.com/code-423n4/2022-11-size/blob/main/src/interfaces/ISizeSealed.sol#L63-L68.
#0 - c4-judge
2022-11-10T02:51:39Z
0xean marked the issue as grade-b