Nibbl contest - Lambda's results

NFT fractionalization protocol with guaranteed liquidity and price based buyout.

General Information

Platform: Code4rena

Start Date: 21/06/2022

Pot Size: $30,000 USDC

Total HM: 12

Participants: 96

Period: 3 days

Judge: HardlyDifficult

Total Solo HM: 5

Id: 140

League: ETH

Nibbl

Findings Distribution

Researcher Performance

Rank: 7/96

Findings: 4

Award: $1,328.64

🌟 Selected for report: 1

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: Lambda

Also found by: SmartSek

Labels

bug
2 (Med Risk)
sponsor disputed

Awards

1052.705 USDC - $1,052.70

External Links

Lines of code

https://github.com/code-423n4/2022-06-nibbl/blob/71b639f977c0351c9928dd3b78eaa4bebb738bc1/contracts/NibblVault.sol#L300 https://github.com/code-423n4/2022-06-nibbl/blob/71b639f977c0351c9928dd3b78eaa4bebb738bc1/contracts/NibblVault.sol#L362 https://github.com/code-423n4/2022-06-nibbl/blob/71b639f977c0351c9928dd3b78eaa4bebb738bc1/contracts/NibblVault.sol#L464 https://github.com/code-423n4/2022-06-nibbl/blob/71b639f977c0351c9928dd3b78eaa4bebb738bc1/contracts/NibblVault.sol#L495

Vulnerability details

Impact

While buy() and sell() are only callable when the system is not paused, redeem() and withdrawERC721() are also callable when it is not. This means that the BUYOUT_DURATION is ignored in such cases and it is possible that users are not able to reject certain buyouts.

Proof of Concept

A user initiates a buyout via initiateBuyout(). Just afterwards, the system is stopped. The token holders now cannot buy new tokens to increase the value. However, after two days, the bidder can still withdraw the NFT, i.e. there was no way for the users to reject this buyout.

It should be possible to reset the buyoutEndTime (to the current block.timestamp) when the system is paused such that the token holders always have the possibility to reject a buyout.

#0 - mundhrakeshav

2022-06-25T16:39:24Z

Expected. When paused no operations should be available.

#1 - fatherGoose1

2022-06-27T00:00:30Z

Strongly disagree with the sponsor's comment. Given that redeem() and withdrawERC721() DO NOT contain the whenNotPaused modifier, this ensures that pauses that occur during a buyout process will ensure the success of the buyout. The buyout success occurs by time passing a certain block.timestamp and the functionality to claim the NFT and retrieve the underlying are left open even during the pause.

Similar to issue #261

I would agree with the sponsor if all of the withdraw()/redeem() functions contained the whenNotPaused modifier so that truly all functions were locked during a pause.

#2 - mundhrakeshav

2022-06-27T02:06:39Z

Hmmm. Makes sense. We should pause redeem and Withdraw too.

#3 - HardlyDifficult

2022-06-30T01:07:14Z

The readme does include "Out of scope: Admin can pause and change certain parameters of the contract." however this report is not strictly about the ability to pause.

It should be possible to reset the buyoutEndTime

In this scenario, an end time has already been defined. If pause is used at that time the window shortens or closes so when resumed the opportunity may have been missed already. The warden's recommendation here, or some variation of it, would provide a way to effectively allow the system to resume from where it left off when originally paused.

I suspect the alternative of also pausing redeem / withdraw is not sufficient, as the window to buy/sell will still potentially be passed by the time the system resumes.

I agree with the submitted Med risk for this issue since the "function of the protocol or its availability could be impacted".

Findings Information

🌟 Selected for report: cccz

Also found by: Lambda, WatchPug, kenzo, xiaoming90, zzzitron

Labels

bug
duplicate
2 (Med Risk)
sponsor disputed

Awards

230.2266 USDC - $230.23

External Links

Lines of code

https://github.com/code-423n4/2022-06-nibbl/blob/71b639f977c0351c9928dd3b78eaa4bebb738bc1/contracts/NibblVault.sol#L319

Vulnerability details

Impact

When a buy can be filled only partially by the secondary curve and the rest is filled by the primary curve, no admin and curator fee is deducted for the part that is filled by the secondary curve (https://github.com/code-423n4/2022-06-nibbl/blob/71b639f977c0351c9928dd3b78eaa4bebb738bc1/contracts/NibblVault.sol#L319). Therefore, a user could avoid buying fees almost completely for certain orders (that increase the secondary curve just above the maximum value).

Also deduct a fee in the linked branch.

#0 - mundhrakeshav

2022-06-25T16:36:54Z

Expected

#1 - HardlyDifficult

2022-07-04T00:11:28Z

#0 - HardlyDifficult

2022-07-04T00:18:28Z

#1 - HardlyDifficult

2022-07-04T17:49:22Z

Good reports, succinct format.

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