Kuiper contest - leastwood's results

Automated portfolio protocol.

General Information

Platform: Code4rena

Start Date: 16/09/2021

Pot Size: $50,000 USDC

Total HM: 26

Participants: 30

Period: 7 days

Judge: GalloDaSballo

Total Solo HM: 17

Id: 36

League: ETH

Kuiper

Findings Distribution

Researcher Performance

Rank: 8/30

Findings: 4

Award: $1,900.29

🌟 Selected for report: 4

🚀 Solo Findings: 1

Findings Information

🌟 Selected for report: hack3r-0m

Also found by: JMukesh, itsmeSTYJ, leastwood, shenwilly

Labels

bug
duplicate
2 (Med Risk)
sponsor confirmed

Awards

131.4735 USDC - $131.47

External Links

Handle

leastwood

Vulnerability details

Impact

The contracts Basket.sol and Auction.sol do not check the return values of several external calls to ERC20 tokens. Some ERC20 tokens may return false for a transfer() call, however, Auction.sol will treat the call as successful.

Proof of Concept

https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Auction.sol#L101 https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Auction.sol#L146 https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Basket.sol#L226

Tools Used

Manual code review

Consider using Openzeppelin's SafeERC20 library to replace all transfer() and approve() calls with safeTransfer() and safeApprove() respectively. This ensures the return values of these external calls are correctly checked.

#1 - GalloDaSballo

2021-12-12T18:11:15Z

Duplicate of #196

Findings Information

🌟 Selected for report: leastwood

Labels

bug
2 (Med Risk)
sponsor acknowledged

Awards

1001.9319 USDC - $1,001.93

External Links

Handle

leastwood

Vulnerability details

Impact

The onlyOwner role is able to make changes to the protocol with an immediate affect, while other changes made in Basket.sol and Auction.sol incur a one day timelock. As a result, an onlyOwner role may unintentionally frontrun a settleAuction() transaction by making changes to auctionDecrement and auctionMultiplier, potentially causing the auction bonder to over compensate during a rebalance. Additionally, there is no way for an auction bonder to recover their tokens in the event this does happen.

Proof of Concept

https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Factory.sol#L39-L59 https://github.com/code-423n4/2021-09-defiProtocol/blob/main/contracts/contracts/Auction.sol#L89-L99

Tools Used

Manual code review

Consider adding a timelock delay to all functions affecting protocol execution. Alternatively, bondForRebalance() can set state variables for any external calls made to Factory.sol (i.e. factory.auctionMultiplier() and factory.auctionDecrement()), ensuring that settleAuction() is called according to these expected results.

#0 - frank-beard

2021-09-30T18:40:57Z

it is assumed the owner is trustworthy in this version of the protocol, however we will add mitigations and further decentralization in future updates

#1 - GalloDaSballo

2021-12-18T13:54:41Z

Agree with the finding, users are taking "owner privileges" risks while interacting with the protocol. The warden has identified a specific grief / DOS that the owner can cause

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