Canto Identity Protocol contest - csanuragjain's results

Protocol Aggregating Protocol (PAP) for standardizing on-chain identity.

General Information

Platform: Code4rena

Start Date: 31/01/2023

Pot Size: $36,500 CANTO

Total HM: 5

Participants: 38

Period: 3 days

Judge: berndartmueller

Total Solo HM: 2

Id: 212

League: ETH

Canto Identity Protocol

Findings Distribution

Researcher Performance

Rank: 16/38

Findings: 1

Award: $108.60

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: joestakey

Also found by: MiniGlome, Ruhum, adriro, chaduke, csanuragjain, glcanvas, hihen, libratus, shenwilly, wait

Labels

bug
2 (Med Risk)
satisfactory
duplicate-177

Awards

360.4223 CANTO - $108.60

External Links

Lines of code

https://github.com/code-423n4/2023-01-canto-identity/blob/main/src/AddressRegistry.sol#L1

Vulnerability details

Impact

The _cidNFTID will be registered to incorrect owner in case of NFT transfer. In some cases this can lead to multiple registration for same _cidNFTID

Proof of Concept

  1. Lets say _cidNFTID 1 is owned by User A
  2. User A registers this _cidNFTID 1 using register function
function register(uint256 _cidNFTID) external { if (ERC721(cidNFT).ownerOf(_cidNFTID) != msg.sender) // We only guarantee that a CID NFT is owned by the user at the time of registration // ownerOf reverts if non-existing ID is provided revert NFTNotOwnedByUser(_cidNFTID, msg.sender); cidNFTs[msg.sender] = _cidNFTID; emit CIDNFTAdded(msg.sender, _cidNFTID); }
  1. Post some time User A transfer this _cidNFTID to User B. This is allowed since cidNFT contract implements ERC721 contract
  2. Since cidNFT does not contain any overridden implementation of transfer so default transfer from ERC721 contract is made
  3. Post transfer the registration still point to old owner. Even if new owner registers, there will be multiple users for same _cidNFTID

Registration of _cidNFTID should be removed if _cidNFTID is transferred

#0 - c4-judge

2023-02-09T12:45:23Z

berndartmueller marked the issue as duplicate of #177

#1 - c4-judge

2023-02-17T21:37:21Z

berndartmueller marked the issue as satisfactory

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