Skip to content

Code4rena

Canto Identity Subprotocols contest

Every publicly disclosed report for Canto Identity Subprotocols contest and what kind of bugs they were.

disclosed reports
15
most reported class
Business logic
bug classes found
6
first disclosure
2023
Find Canto Identity Subprotocols contest on bugbounty.fyi Current scope, rewards and status, if it runs a public program.

Disclosed reports

Newest first. Only what Canto Identity Subprotocols contest chose to make public.

Business logic

Users will be able to purchase fewer NFTs than the project had anticipated

The fuse function in the Namespace contract incorrectly passes a font class of 0 to the character-to-Unicode conversion, causing all font classes to produce the same name. As a result, users cannot mint names with different font classes because the name is already registered.

Canto Identity Subprotocols contest

High
Business logic

ProfilePicture subprotocol is immutably linked by subprotocolName to the CID protocol

The ProfilePicture contract fixes its subprotocol name at construction time, so it must be registered in the SubprotocolRegistry under exactly that name to work. If someone else registers that name first, the contract cannot simply be re-registered under a different name and would have to be redeployed.

Canto Identity Subprotocols contest

Medium
DoS

Bio lines will overflow the buffer for repeated “continuation” characters

The Bio tokenURI function splits biography text into lines, but when the text contains repeated Unicode continuation characters, the line buffer overflows and the transaction reverts. An attacker could mint a bio with such text, causing tokenURI to revert and potentially making the token unusable.

Canto Identity Subprotocols contest

Medium
Business logic

Incorrect emoji displaying

The Bio contract's tokenURI function incorrectly splits bio text into lines when the text contains certain emoji sequences, such as the England flag, because it does not handle all Unicode cases. This leads to an incorrect display of the generated image, which cannot be modified afterwards, potentially causing integration problems.

Canto Identity Subprotocols contest

Medium
XSS

Bio Protocol - tokenURI JSON injection

The tokenURI function of the Bio NFT contract did not escape user-supplied bio text, allowing an attacker to inject JSON keys and alter the returned metadata. This could let an attacker spoof the NFT name, change the image, or potentially trigger cross-site scripting if the JSON is mishandled by a frontend.

Canto Identity Subprotocols contest

Medium
Smart contracts

The range of iteratePRNG limits the number of Zalgo distortions

The pseudo-random generator used to build Zalgo text distortions reduces its state modulo a small constant, so only a tiny fraction of the possible distortions can ever be produced. An attacker could not gain anything directly; the effect is that the visual variety of generated names is far smaller than intended.

Canto Identity Subprotocols contest

Medium
Business logic

If the underlying NFT is burned, getPFP may return incorrect results

The getPFP function in ProfilePicture.sol may return incorrect information if the underlying NFT is burned, because it compares the address registry's address with the NFT owner, and both can be zero. An attacker could exploit this to make getPFP return a non-zero contract address and ID for a burned NFT, potentially causing bugs in integrating projects.

Canto Identity Subprotocols contest

Medium
Business logic

characterModifier is uint8 but encodes 1.38e24 different Zalgo distortions

The characterModifier field is a uint8, so only 256 Zalgo distortions are possible per letter, while the code's parameters imply 1.38e24 combinations. An attacker could not exploit this for gain, but users cannot obtain many desired distortions and duplicates occur.

Canto Identity Subprotocols contest

Medium
Misconfiguration

CidNFT : Broken tokenURI function

The tokenURI function interpolated the raw 32-byte ABI-encoded integer ID into the URI instead of its decimal string form, so token URIs contained control characters or symbols rather than readable numbers. Offchain tools reading tokenURI could break or display malformed data.

Canto Identity Subprotocols contest

Medium
Business logic

Griefing risk in mint

The mint function allows an optional list of subprotocol NFTs to register, but the encoded CID NFT ID is not guaranteed to match the newly minted ID. An attacker can frontrun a mint transaction to cause the victim's transaction to revert, or this can happen randomly during busy periods.

Canto Identity Subprotocols contest

Medium
Business logic

Attacker can frontrun a victim’s mint + add transaction to steal NFT

The mint function allowed a user to attach subprotocol NFTs to any CidNFT they were approved for, not just the one they just minted. An attacker could frontrun a victim's mint and add transaction, mint the expected token ID, set the victim as approved, and then the victim's add call would attach their NFTs to the attacker's token, letting the attacker steal them.

Canto Identity Subprotocols contest

High
Access control

Multiple accounts can have the same identity

The AddressRegistry contract allowed multiple accounts to register the same CID NFT as their identity because it only checked current ownership at registration time and did not prevent an NFT from being registered by more than one address. An attacker could transfer their registered NFT to another account, which then registers it, causing both accounts to share the same identity and potentially gain traits or rewards without paying.

Canto Identity Subprotocols contest

Medium