Nibbl contest - Wayne'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: 76/96

Findings: 1

Award: $28.28

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2022-06-nibbl/blob/main/contracts/NibblVaultFactory.sol#L113 https://github.com/code-423n4/2022-06-nibbl/blob/main/contracts/NibblVaultFactory.sol#L25 https://github.com/code-423n4/2022-06-nibbl/blob/main/contracts/NibblVaultFactory.sol#L132

Vulnerability details

Impact

Detailed description of the impact of this finding.

There are two possible issues here.

The address feeTo is set directly in the constructor, but I noticed that there is no further check to see if this address is a 0 address, and that feeTo will be set to a 0 address if the constructor is not passed a parameter to the function, and that it takes time to change the feeTo address, and after initiating a proposal, the address can only be changed when the delay has ended If a malicious user calls this function, the full amount of Ether in the Factory contract will be sent to the 0x000 black hole address! This means that the money will be locked up in the black hole address forever.

Another problem is that

The current FEE_ROLE privileged account calls the proposeNewAdminFeeAddress() function to initiate the proposal to change the pendingFeeTo address and feeToUpdateTime, because the 0x000 address is not checked and if ADMIN does not notice anything different, once pendingFeeTo is set to 0x000 and a malicious attacker listens to the contract, calls updateNewAdminFeeAddress() to set the feeTo to 0x000 as soon as the current time exceeds the previously set feeToUpdateTime, and immediately afterwards calls withdrawAdminFee() function, at which point the full amount of Ether in the Factory contract will be sent to the 0x000 black hole address! This means that the funds will be locked in the black hole address forever.

Proof of Concept

Provide direct links to all referenced code in GitHub. Add screenshots, logs, or any other relevant proof that illustrates the concept.

Tools Used

Add access control to the withdrawAdminFee function and check that feeTo is not a Zero Address

#0 - GalloDaSballo

2022-06-26T22:08:36Z

Address 0 check, historically low severity, being suggested as High Severity finding

#1 - HardlyDifficult

2022-07-03T12:34:24Z

Good report. I agree that checking for != address(0) is a worthwhile addition.

Validating the input field is non-zero is a nice to have. It's effectively not much different than making a simple typo when inserting the expected address - which we cannot guard against in the contract. Lowing to Low risk and converting this into a QA report for the warden.

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