Project

One World
NFTDeFi
15,000 USDC
View results
Submission Details
Severity: medium
Invalid

It is possible to mint 'OWPtoken' with the same identifier for different addresses.

Summary

OWPIdentity: A non-transferrable token that identifies a user within the One World Project ecosystem. It follows from this that each 'OWPtoken' must have a unique ID and have no matches.

But when minting (OWIdentity::mint or OWIdentity::mintBatch), it is not checked that a ID already exists. 'MINTER_ROLE' can mint the same token for different KYC`ed users.

Vulnerability Details

PoC(foundry):

pragma solidity 0.8.22;
import {Test, console} from "forge-std/Test.sol";
import {OWPIdentity} from "../contracts/OWPIdentity.sol";
contract OWPIdentityTest is Test {
OWPIdentity public identity;
address public defaultAdmin;
address public minter;
function setUp() public {
defaultAdmin = makeAddr("defaultAdmin");
minter = makeAddr("minter");
identity = new OWPIdentity(defaultAdmin, minter, "https://example.com/");
}
function test_mint() public {
address KYCedUser1 = makeAddr("KYCedUser1");
address KYCedUser2 = makeAddr("KYCedUser2");
uint256 tokenId1 = 101;
uint256 tokenId2 = 102;
vm.startPrank(minter);
identity.mint(KYCedUser1, tokenId1, 1, "");
identity.mint(KYCedUser1, tokenId2, 1, "");
identity.mint(KYCedUser2, tokenId1, 1, "");
vm.stopPrank();
address[] memory accounts = new address[]();
accounts[0] = KYCedUser1;
accounts[1] = KYCedUser2;
uint256[] memory ids = new uint256[]();
ids[0] = tokenId1;
ids[1] = tokenId1;
uint256[] memory balances = identity.balanceOfBatch(accounts, ids);
console.log("KYCedUser1 balance: tokenId1 = ", balances[0]);
console.log("KYCedUser2 balance: tokenId1 = ", balances[1]);
console.log("totalSupply tokenId1: ", identity.totalSupply(tokenId1));
assertEq(identity.balanceOf(KYCedUser1, tokenId1), identity.balanceOf(KYCedUser2, tokenId1));
}
}

Impact

When there are different KYC'ed users in the OWP ecosystem with the same ID, this may violate part of the project logic based on identification.

Tools Used

Manual review, Foundry

Recommendations

It is recommended to consider adding a check to the OWIdentity::mint and OWIdentity::mintBatch that the ID already exists.

Updates

Lead Judging Commences

0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Appeal created

crmx_lom Submitter
10 months ago
0xbrivan2 Lead Judge
10 months ago
0xbrivan2 Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.