Skip to content
Misconfiguration Audit finding Intermediate

Basket NFT have no name and symbol

The Basket contract is meant to be used behind a proxy, but the ERC721 implementation is not upgradeable and its constructor sets the name and symbol only on the implementation. As a result, every proxy has an empty name and symbol, which breaks integrations and listings.

Picodes Follow

Originally disclosed on Code4rena

Submitted by Picodes, also found by cccz

https://github.com/code-423n4/2022-06-nibbl/blob/8c3dbd6adf350f35c58b31723d42117765644110/contracts/Basket.sol#L13

https://github.com/code-423n4/2022-06-nibbl/blob/8c3dbd6adf350f35c58b31723d42117765644110/contracts/Basket.sol#L6

Impact

The Basket contract is intended to be used behind a proxy. But the ERC721 implementation used is not upgradeable, and its constructor is called at deployment time on the implementation. So all proxies will have a void name and symbol, breaking all potential integrations and listings.

Proof of Concept

ERC721("NFT Basket", "NFTB") is called at deployment time, and sets private variable at the implementation level. Therefore when loading the code during delegateCall, these variables will not be initialized.

Recommended Mitigation Steps

The easiest mitigation would be to pass this variable as immutable so they are hardcoded in the implementation byte code.

mundhrakeshav (Nibbl) confirmed

Alex the Entreprenerd (warden) commented:

Finding is valid, impact is the name of the tokens.

HardlyDifficult (judge) decreased severity to QA and commented:

Confirmed this is an issue.

Assets are not at risk, and the function of the protocol is not impacted. All baskets created will have an empty name/symbol but generally there is no requirement that these values are populated. It’s mostly for a better experience on frontends including etherscan. Downgrading and merging with the warden’s QA report #314.

Picodes (warden) commented:

@HardlyDifficult Indeed it does not break the protocol’s logic and funds are not at risk, but the name and the symbol of the NFTs are not the ones chosen by the sponsor, and as it’s the core of EIP721Metadata we could argue that the function of the protocol are impacted. Also the experience on frontends (etherscan, opensea, etc) would have been significantly degraded. It could easily be considered a medium issue to me - especially considering the previous comments / reactions and the label “confirmed” added by the sponsor while it was high.

HardlyDifficult (judge) increased severity to Medium and commented:

Thanks @Picodes! I can get onboard with that line of thinking. Given how significant these fields are for 3rd party integrators such as Etherscan and Opensea this can be considered to fall under that definition of Medium risk. I’ll upgrade this report and the dupes to Medium.


The original report as published on Code4rena, by Picodes. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The ERC721 constructor sets the name and symbol on the implementation contract, but those values are not stored in the proxy when calls are delegated.

Impact

All baskets created will have an empty name and symbol, which degrades the experience on frontends such as Etherscan and OpenSea and breaks potential integrations, though funds are not at risk.

What the attacker needed

Contract used behind a proxy

The fix

The name and symbol should be passed as immutable values so they are hardcoded in the implementation bytecode.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A proxy is a contract that forwards calls to another contract, so the real logic lives elsewhere. The name and symbol of the NFT were set only in the logic contract, not in the proxy, so the proxy appears to have no name or symbol. This makes it hard for wallets and marketplaces to display the NFT correctly.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by Picodes

View all

17 more disclosed reports, best first.

More from Nibbl contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.