Lack of msg sender validation in collection creation signature enables front running attack leading to creator impersonation
The collection-creation signature checked only the collection parameters and chain ID, not the address of the caller, so a valid signature could be reused by anyone. An attacker watching pending transactions could copy the signature and parameters, pay more gas to get in first, and become the collection creator, taking the mint revenue and blocking the real creator.
- Disclosed after under an hour
57895 sc medium lack of msg sender validation in collection creation signature enables front running attack leading to creator impersonation
Submitted on Oct 29th 2025 at 11:51:25 UTC by @Yuubee for Audit Comp | Belong
- Report ID: #57895
- Report Type: Smart Contract
- Report severity: Medium
- Target: https://github.com/immunefi-team/audit-comp-belong/blob/main/contracts/v2/utils/SignatureVerifier.sol
- Impacts:
- Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield
- Unauthorized minting of NFTs
Description
Brief/Intro
The Factory.produce() function uses signature verification to authorize AccessToken collection creation, but the signature does not include the intended creator's address (msg.sender). This allows an attacker to intercept a valid signature and front-run the legitimate transaction, deploying the collection under their own address and receiving all mint revenues intended for the original creator.
Vulnerability Details
In SignatureVerifier.sol, the checkAccessTokenInfo function validates collection creation without binding the signature to a specific creator:
{% code title="SignatureVerifier.sol:checkAccessTokenInfo" %}
function checkAccessTokenInfo(address signer, AccessTokenInfo memory accessTokenInfo) external view {
require(
signer.isValidSignatureNow(
keccak256(
abi.encodePacked(
accessTokenInfo.metadata.name,
accessTokenInfo.metadata.symbol,
accessTokenInfo.contractURI,
accessTokenInfo.feeNumerator,
block.chainid
)
),
accessTokenInfo.signature
),
InvalidSignature()
);
}
{% endcode %}
Notice that msg.sender is NOT included in the signed message.
In Factory.sol:produce(), the creator is set based on the transaction sender, not validated against the signature:
{% code title="Factory.sol:produce (relevant excerpt)" %}
function produce(AccessTokenInfo memory accessTokenInfo, bytes32 referralCode)
external
returns (address nftAddress)
{
// ... signature check (doesn't validate msg.sender) ...
AccessToken(nftAddress).initialize(
AccessToken.AccessTokenParameters({
factory: Factory(address(this)),
info: accessTokenInfo,
creator: msg.sender, // <-- Attacker becomes creator!
feeReceiver: receiver,
referralCode: referralCode
}),
factoryParameters.transferValidator
);
}
{% endcode %}
Because the signature doesn't bind to the expected creator address, anyone who obtains a valid signature and parameters can call produce() and become the creator.
Impact Details
An attacker monitoring the mempool can:
- Intercept legitimate collection creation transactions containing valid backend signatures
- Extract the signature and parameters from the pending transaction
- Submit their own transaction with higher gas to front-run the legitimate transaction
- Deploy the collection under their address, becoming the creator
- Receive all mint revenues that should go to the legitimate creator
- Prevent the legitimate creator from deploying a collection with that name/symbol (due to the uniqueness check)
Consequences:
- Direct financial loss to legitimate creators (all mint fees)
- Brand/collection hijacking if the name/symbol has value
- Denial of service for the intended creator
- Reputational damage to the platform
{% hint style="warning" %} This vulnerability enables creator impersonation and financial theft via a mempool front-running attack. It should be considered a high-priority fix for any production deployment that issues off-chain signatures for on-chain actions. {% endhint %}
Recommended Mitigation
Include msg.sender (the expected creator) in the signed message so that the signature can only be used by the intended creator. Example change:
{% code title="SignatureVerifier.sol - include expectedCreator in verification" %}
function checkAccessTokenInfo(
address signer,
address expectedCreator, // Add this parameter
AccessTokenInfo memory accessTokenInfo
) external view {
require(
signer.isValidSignatureNow(
keccak256(
abi.encodePacked(
expectedCreator, // Include msg.sender in hash
accessTokenInfo.metadata.name,
accessTokenInfo.metadata.symbol,
accessTokenInfo.contractURI,
accessTokenInfo.feeNumerator,
block.chainid
)
),
accessTokenInfo.signature
),
InvalidSignature()
);
}
{% endcode %}
Then update the call site in Factory.produce():
{% code title="Factory.sol - pass msg.sender to signature check" %}
factoryParameters.signerAddress.checkAccessTokenInfo(
msg.sender, // Pass the expected creator
accessTokenInfo
);
{% endcode %}
This binds the signature to the intended creator address and prevents an attacker from reusing the signature from another sender.
Proof of Concept
{% stepper %} {% step %}
Step 1 — Legitimate creator requests signature
Alice wants to create an NFT collection "CoolNFTs" (COOL). She requests a signature from the backend signer with her collection parameters:
- name: "CoolNFTs"
- symbol: "COOL"
- contractURI: "ipfs://..."
- feeNumerator: 500 (5% royalty) {% endstep %}
{% step %}
Step 2 — Backend signs the parameters
The backend signs keccak256(name, symbol, contractURI, feeNumerator, chainid) and returns the signature to Alice. {% endstep %}
{% step %}
Step 3 — Alice submits transaction
Alice calls Factory.produce() with the signed AccessTokenInfo.
{% endstep %}
{% step %}
Step 4 — Attacker monitors mempool
Bob (attacker) sees Alice's pending transaction and extracts:
- The signed
AccessTokenInfostruct - The signature
- All parameters {% endstep %}
{% step %}
Step 5 — Attacker front-runs
Bob submits an identical transaction with higher gas price, calling Factory.produce() with the same AccessTokenInfo and signature.
{% endstep %}
{% step %}
Step 6 — Attacker's transaction executes first
Because the signature does not validate msg.sender, the signature check passes and the collection is deployed with Bob as creator:
// In Bob's transaction
AccessToken(nftAddress).initialize(
/* ... */,
creator: Bob, // Bob becomes the creator!
/* ... */
);
{% endstep %}
{% step %}
Step 7 — Alice's transaction fails
When Alice's transaction eventually executes, it reverts with TokenAlreadyExists() because the same name/symbol (salt) was already used.
{% endstep %}
{% step %}
Step 8 — Attacker profits
Bob now owns the "CoolNFTs" collection. When users mint NFTs, funds intended for Alice go to Bob:
// In AccessToken._pay()
uint256 amountToCreator;
unchecked {
amountToCreator = amount - fees;
}
// Funds go to Bob instead of Alice
_parameters.creator.safeTransferETH(amountToCreator);
{% endstep %} {% endstepper %}
References
- Factory.sol:produce() function
- SignatureVerifier.sol:checkAccessTokenInfo()
- AccessToken.sol:initialize()
If desired, I can produce a suggested patch diff for the repository to implement the mitigation (including updated function signatures and all call sites).
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
The signed message omitted the expected creator address, so the signature authorised the parameters rather than a specific caller.
Impact
The attacker could become the creator and receive all mint revenue, while the legitimate creator is blocked from deploying that name and symbol.
What the attacker needed
Valid backend signature for a collection; attacker can watch the mempool; attacker pays higher gas
The fix
The signature should include the expected creator address, and the factory should pass the caller into the verification so the signature only works for that sender.
How it was found
- The legitimate creator asks the backend for a signature over the collection parameters.
- The backend signs the parameters and returns the signature.
- The creator submits the creation transaction with the signed data.
- The attacker sees the pending transaction and copies the signed data and signature.
- The attacker resubmits the same call with a higher gas price so it executes first.
- The creator's later transaction reverts because the name and symbol are already taken.
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 collection, a backend service signs a message to say the request is approved. The contract checked that signature but never checked who was sending it, so the approval worked for anybody. Someone could copy the approval from a pending transaction, send it first with a higher fee, and end up owning the collection and its earnings.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.