SIZE contest - simon135's results

An on-chain sealed bid auction protocol.

General Information

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

SIZE

Findings Distribution

Researcher Performance

Rank: 46/88

Findings: 2

Award: $49.89

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

5.604 USDC - $5.60

Labels

bug
2 (Med Risk)
downgraded by judge
satisfactory
edited-by-warden
duplicate-237

External Links

Lines of code

https://github.com/code-423n4/2022-11-size/blob/969b9591b89ab21dcc9a13925809696dcaf43938/src/SizeSealed.sol#L347

Vulnerability details

Impact

Attacker can fill up all the bids and steal and be the winner and cause a dos and then withdraw/refund the funds since when doing a refund the bid isn't taken off the array an attacker can make 1000 bids and cause dos and have 100 percent chance of winning causing a loss of funds

Proof of Concept

There is no fee taken on the amount and there can be dos and it should be removed.

b.sender = address(0); emit BidRefund(auctionId, bidIndex); SafeTransferLib.safeTransfer(ERC20(a.params.quoteToken), msg.sender, b.quoteAmount); }

and no array slot popped off which can be filled causing 100 percent winnings for the bidder they are able to get all the bid amounts out and even if they don't win they cant dos the whole auction and still get their funds out with no punishment.

Tools Used

remove the bid from an array or check the address

psudeocode array.pop()

#0 - trust1995

2022-11-08T22:22:19Z

Lacking any specifics, believe it to be unsatisfactory.

#1 - c4-judge

2022-11-09T17:20:47Z

0xean marked the issue as duplicate

#2 - trust1995

2022-11-29T15:31:17Z

The submission does not explain a DOS vector properly and is not on par with the rest of the dups, imo.

#3 - c4-judge

2022-12-06T00:21:57Z

0xean marked the issue as satisfactory

#4 - c4-judge

2022-12-06T00:31:00Z

0xean changed the severity to 2 (Med Risk)

Awards

44.2869 USDC - $44.29

Labels

bug
grade-b
QA (Quality Assurance)
edited-by-warden
Q-14

External Links

this if statment might not work because of the wrong check

// Fill the remaining unfilled base amount if (data.filledBase + baseAmount > data.totalBaseAmount) { //@done this if statement is wrong baseAmount = data.totalBaseAmount - data.filledBase; } b.filledBaseAmount = baseAmount; data.filledBase += baseAmount;

if baseAmount is more then totalBaseAmonut then it will revert

// Auction has been fully filled if (data.filledBase == data.totalBaseAmount) continue;

https://github.com/code-423n4/2022-11-size/blob/969b9591b89ab21dcc9a13925809696dcaf43938/src/SizeSealed.sol#L289

there can be a transfer of 0 tokens and some tokens will revert

and this is possible if the base amounts are equal but then you wont get the quote amount

// Transfer the left over baseToken if (data.totalBaseAmount != data.filledBase) { uint128 unsoldBase = data.totalBaseAmount - data.filledBase; a.params.totalBaseAmount = data.filledBase; SafeTransferLib.safeTransfer( ERC20(a.params.baseToken), a.data.seller, unsoldBase ); }

edge case with vesting with e18 when the tokens vesting goes down and withdraw is more then it will revert

when you should get tokens

baseTokensAvailable = baseTokensAvailable - b.baseWithdrawn; b.baseWithdrawn += baseTokensAvailable;

just of time the loop will get to this

bta=BaseTokenAmount bw=basewithdraw /* bta=1e18 bw=1e18 bta=1e14 bw=1e22 bta=1e10 bta-bw//revert */

as the tokens decrease the bw will get bigger causing a revert

#0 - c4-judge

2022-11-10T02:48:15Z

0xean marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter