Skip to content
Business logic Audit finding Beginner

Allowed minting of nfts after collection expiry date

The NFT smart contract does not check the collection expiry timestamp during minting, so anyone can mint tokens after the collection has expired. This could allow continuous minting until the maximum supply is reached, potentially affecting the collection's market price.

chinepun Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

57255 sc low allowed minting of nfts after collection expiry date

Submitted on Oct 24th 2025 at 18:34:43 UTC by @chinepun for Audit Comp | Belong

Description

Brief / Intro

The smart contract allows anyone to mint tokens after the NFT collection's expiry timestamp has passed. In other words, users can still mint tokens after the configured expiration timestamp.

Vulnerability Details

The NftParameters structure contains a field collection_expires which tracks the expiration timestamp for the NFT collection. See:

However, during minting (via _mint_static_price_batch or _mint_dynamic_price_batch), the _base_mint function does not check whether the collection has expired before minting:

Excerpt from _base_mint (no expiration check):

CAIRO
assert(
    token_id + 1 <= self.nft_parameters.max_total_supply.read(),
    super::Errors::TOTAL_SUPPLY_LIMIT,
);// it checks here that nft total supply is not exceeded after mint
// this updates metadata of tokens after mint
self.nft_node.total_supply.write(self.nft_node.total_supply.read() + 1);
self.nft_node.metadata_uri.write(token_id, token_uri);

self.erc721.safe_mint(recipient, token_id, array![].span());// this does the actual minting

As shown, _base_mint validates total supply but does not verify collection_expires before performing the mint.

Impact Details

Because expiration is not enforced, NFTs can be minted after the intended expiration date. This may allow continuous minting until max_total_supply is reached, potentially crashing the collection's market price or allowing unauthorized minting beyond the intended sale period.

References

Proof of Concept

The repository already contains tests covering mint behavior: https://github.com/immunefi-team/audit-comp-belong/blob/feat/cairo/src/tests/test\\_nft.cairo#L508-L574

You can reproduce the issue by changing the collection expiry used in tests to an expired timestamp (0) and running the test. The test still passes, demonstrating minting occurs despite an expired collection.

{% stepper %} {% step %}

Step: Modify test to set collection_expires to 0

Edit src/tests/test_nft.cairo to set collection_expires: 0:

Diff
diff --git a/src/tests/test_nft.cairo b/src/tests/test_nft.cairo
index 4d3eea6..4e55105 100644
--- a/src/tests/test_nft.cairo
+++ b/src/tests/test_nft.cairo
@@ -124,8 +124,7 @@ fn deploy_factory_nft_receiver_erc20(
         max_total_supply: constants::MAX_TOTAL_SUPPLY(),
         mint_price: constants::MINT_PRICE(),
         whitelisted_mint_price: constants::WL_MINT_PRICE(),
-        //collection_expires: constants::EXPIRES(),
+        collection_expires: 0,
         referral_code: referral,
         signature,
     };

{% endstep %}

{% step %}

Step: Run the specific test

Run the test:

scarb test test_mintDynamicPrice_referral

{% endstep %}

{% step %}

Step: Observe passing test (minting despite expiry)

Expected test output shows the mint succeeded even though the collection expiry was set to 0 (expired):

Running 1 test(s) from src/
platfrom_balance_after + referral_balance_after should be 10 % from price: 10000000
platfrom_balance_after should be 5 % from price: 5000000
referral_balance_after should be 5 % from price: 5000000
creator_balance_after should be without 10 % from price: 90000000
[PASS] nft::tests::test_nft::test_mintDynamicPrice_referral (gas: ~4875)
Tests: 1 passed, 0 failed, 0 skipped, 0 ignored, 46 filtered out

This demonstrates NFTs were minted although collection_expires was set to an expired timestamp. {% endstep %} {% endstepper %}

Recommendations (not prescriptive)

  • Add a check in the minting flow (e.g., in _base_mint or the public mint wrapper functions) that asserts the current timestamp is less than or equal to collection_expires before proceeding to mint.
  • Ensure unit tests include cases that verify minting reverts when collection_expires is in the past.

(Note: recommendations are general guidance based on the reported behavior; they do not add new information beyond the report.)

The original report as published on Immunefi, by chinepun. 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

The minting function `_base_mint` checks the total supply limit but does not verify that the current time is before `collection_expires`.

Impact

NFTs can be minted after the intended expiration date, potentially allowing continuous minting until `max_total_supply` is reached and affecting the collection's market price.

What the attacker needed

None

The fix

Add a check in the minting flow that asserts the current timestamp is less than or equal to `collection_expires` before minting.

How it was found

  1. Modify the test to set `collection_expires` to 0 (an expired timestamp).
  2. Run the specific test `test_mintDynamicPrice_referral`.
  3. Observe that the test passes, showing minting succeeded despite the expired collection.

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.

An NFT collection can have an expiry date, after which no new tokens should be created. The contract forgets to check this date when someone tries to mint, so minting still works even after expiry. This means the intended sale period is not enforced.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More from Belong

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.