Skip to content
Smart contracts Audit finding Intermediate

Signature replay enables frontrunning of produce producecredittoken

The signature verification for creating token collections does not bind the signature to the caller, allowing anyone to reuse a valid signature. An attacker can front-run a legitimate creation transaction and deploy the same collection first, permanently blocking the original creator from using that name and symbol.

DoD4uFN Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

57580 sc medium signature replay enables frontrunning of produce producecredittoken

Submitted on Oct 27th 2025 at 10:40:27 UTC by @DoD4uFN for Audit Comp | Belong

Description

Brief/Intro

Both the produce() and produceCreditToken() functions in Factory.sol allow users to create new token collections (AccessToken and CreditToken, respectively) after obtaining a valid signature from the platform’s signer. However, the signature verification does not bind the signature to the caller, allowing anyone to reuse a valid signature meant for another user.

As a result, a malicious actor can front-run legitimate creation transactions and deploy the same collection before the rightful creator, permanently blocking them from using the same name and symbol, which are unique identifiers across the platform.

Vulnerability Details

Both produce() and produceCreditToken() rely on EIP-712/ECDSA signature validation to ensure the platform authorizes a collection’s metadata. However, neither the checkAccessTokenInfo() nor checkCreditTokenInfo() functions include the creator’s address in the signed payload. This omission means that a valid signature is reusable by anyone, making it possible for an attacker to frontrun a legitimate user’s collection creation and deploy it under their own address.

For example, in produce():

Solidity
factoryParameters.signerAddress.checkAccessTokenInfo(accessTokenInfo);
...
bytes32 hashedSalt = _metadataHash(accessTokenInfo.metadata.name, accessTokenInfo.metadata.symbol);
require(getNftInstanceInfo[hashedSalt].nftAddress == address(0), TokenAlreadyExists());

and similarly in produceCreditToken():

Solidity
_nftFactoryParameters.signerAddress.checkCreditTokenInfo(signature, creditTokenInfo);
...
bytes32 hashedSalt = _metadataHash(creditTokenInfo.name, creditTokenInfo.symbol);
require(_creditTokenInstanceInfo[hashedSalt].creditToken == address(0), TokenAlreadyExists());

In both functions, the deterministic salt is defined as:

Solidity
function _metadataHash(string memory name, string memory symbol) private pure returns (bytes32) {
    return keccak256(abi.encode(name, symbol));
}

Since the salt is derived solely from name and symbol, and uniqueness is enforced via TokenAlreadyExists(), the first entity to call the function with a given (name, symbol) pair “locks” that pair forever.

Impact Details

This vulnerability enables signature replay and collection identity theft across both AccessToken (ERC721) and CreditToken (ERC1155) deployments.

While direct fund loss is not immediate, the exploit effectively breaks creator authorization guarantees the signature mechanism is intended to enforce.

References

Proof of Concept

Steps

{% stepper %} {% step %}

Step 1

Alice obtains a valid signature from the factory’s signer for creating a new collection:

  • name = "CoolCats"
  • symbol = "CCAT" {% endstep %}

{% step %}

Step 2

Alice prepares a transaction calling:

Solidity
Factory.produce(accessTokenInfo, referralCode)

{% endstep %}

{% step %}

Step 3

An attacker monitors the mempool, copies Alice’s transaction data, and resubmits it first with a higher gas price. {% endstep %}

{% step %}

Step 4

Since msg.sender is not part of the signed payload, the contract accepts the attacker’s transaction as valid. {% endstep %}

{% step %}

Step 5

The attacker’s transaction deploys the collection first, occupying the salt (CoolCats, CCAT). {% endstep %}

{% step %}

Step 6

When Alice’s transaction executes, it reverts with TokenAlreadyExists(). {% endstep %}

{% step %}

Step 7

The attacker has effectively stolen the collection name/symbol pair and blocked Alice’s deployment permanently. {% endstep %} {% endstepper %}

Proof of Concept (code)

Should be added in factory.tests.ts @ Deploy AccessToken:

TypeScript
it('Deploy AccessToken Griefing Immunefi POC', async () => {
  const { signatureVerifier, factory, validator, alice, bob, signer } = await loadFixture(fixture);

  const nftName = 'CoolCats';
  const nftSymbol = 'CCAT';
  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,
  };

  // alice calls produce, but bob frontruns alice
  // const txAlice = await factory.connect(alice).produce(info, ethers.constants.HashZero);
 
  // bob's transaction gets included first
  const txBob = await factory.connect(bob).produce(info, ethers.constants.HashZero);
  await expect(txBob).to.emit(factory, 'AccessTokenCreated');

  // alice's transaction gets reverted
  await expect(factory.connect(alice).produce(info, ethers.constants.HashZero)).to.be.revertedWithCustomError(factory, 'TokenAlreadyExists');
});

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

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 signed message does not include the creator's address, so the signature can be replayed by anyone.

Impact

An attacker could front-run and permanently block a legitimate creator from deploying a collection with a chosen name and symbol, breaking creator authorization guarantees.

What the attacker needed

Attacker can see pending transactions; attacker can pay higher gas

How it was found

  1. Alice obtains a valid signature from the factory's signer for a new collection with a specific name and symbol.
  2. Alice prepares a transaction calling Factory.produce with the collection info.
  3. An attacker monitors the mempool, copies Alice's transaction data, and resubmits it first with a higher gas price.
  4. The contract accepts the attacker's transaction because msg.sender is not part of the signed payload.
  5. The attacker's transaction deploys the collection first, occupying the name and symbol.
  6. When Alice's transaction executes, it reverts with TokenAlreadyExists.

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 you create a new token collection, the platform gives you a digital signature to prove it approved your collection's name and symbol. The problem is that this signature doesn't say who is allowed to use it, so anyone who sees it can use it first. This lets an attacker grab your collection name before you do, and you can never use it again.

What is Smart contracts?

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.

More by DoD4uFN

View all

6 more disclosed reports, best first.

More from Belong

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Smart contract vulnerabilities

The lesson behind this report.

Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.