57388 sc medium cross contract signature replay because verifying contract is not included in the digest

Submitted on Oct 25th 2025 at 18:07:06 UTC by @kaysoft for Audit Comp | Belongarrow-up-right

  • Report ID: #57388

  • Report Type: Smart Contract

  • Report severity: Medium

  • Target: https://github.com/immunefi-team/audit-comp-belong/blob/main/contracts/v2/tokens/AccessToken.sol

  • Impacts:

    • Griefing (e.g. no profit motive for an attacker, but damage to the users or the protocol)

Description

Brief/Intro

A user can use just one signature to call mintStaticPrice(...) on multiple AccessTokens to mint NFTs.

This is because the verifying contract is not included in the signed digest.

Vulnerability Details

Signature verification on the codebase is not EIP-712 compliant because it fails to include the verifying contract (and other contextual data) in the digest that is signed.

Even the SignatureCheckerLib.sol that isValidSignatureNow(...) uses for signature verification has a warning at the top:

Use EIP-712 for the digest to prevent replay attacks across different chains and contracts.

Currently signature verification includes blockchain ids in the digest and verification which will prevent cross-chain replay attacks but does not include the particular contract that will verify the signature in the signed digest.

This allows any user with a signature meant for a particular AccessToken to be able to mint on other AccessTokens that the user does not have signatures for.

There will be multiple AccessTokens and a signature is supposed to be meant for a particular accessToken since its token URI and other metadata are unique to the access token, but with cross-contract signature replay it is possible to reuse one signature across different AccessTokens.

Example from the codebase:

File: AccessToken.sol

As can be seen below, the verifying contract is not included in the digest which makes a single signature usable on multiple different AccessTokens.

File: SignatureVerifyer.sol

Impact Details

A user with a signature to mint from one AccessToken with the mintStaticPrice(...) function can use the same signature to mint from other AccessTokens.

References

Consider ensuring signature verification is EIP-712 compliant as warned in SignatureCheckerLib.sol.

Use EIP-712 for the digest to prevent replay attacks across different chains and contracts.

Proof of Concept

1

Proof of Concept (setup & deploy)

  1. Copy and paste the test below to the accessToken.test.ts file in the 'Withdraw test' test suite.

  2. Run yarn test

The test demonstrates that a user can use a signature meant for accessTokenEth1 to mint an NFT from both accessTokenEth1 and accessTokenEth2.

2

Proof of Concept (test body)

Was this helpful?