Skip to content
Crypto Audit finding Intermediate

Cross-Chain Signature Replay Attack in Settlement Contract

The Settlement contract's signature hash omits the chain ID and contract address, so an operator signature from one chain validates on another deployment. An attacker could replay a legitimate settlement on a different chain, causing unauthorised settlements.

Catchme Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#47125 [SC-Medium] Cross-Chain Signature Replay Attack in Settlement Contract

Submitted on Jun 9th 2025 at 04:04:55 UTC by @Catchme for IOP | Term Structure Institutional

Description

Brief/Intro

The Settlement contract is vulnerable to cross-chain signature replay attacks due to insufficient domain binding in the signature generation process. This allows attackers to capture legitimate operator signatures from one blockchain network and replay them on another where the same contract is deployed, potentially leading to unauthorized settlements across chains.

Vulnerability Details

The vulnerability exists in the _getSettlementHash() function at lines 113-118 of Settlement.sol:

Solidity
function _getSettlementHash(
    string memory _settlementId,
    SettleInfo calldata _settleInfo,
    string[] memory _loanIds,
    LoanInfo[] calldata _loans
) private pure returns (bytes32) {
    return keccak256(abi.encode(_settlementId, _settleInfo, _loanIds, _loans)).toEthSignedMessageHash();
}

This function generates the message hash used for operator signature verification but has two critical omissions:

  1. Missing Chain ID: No blockchain identifier is included in the hash, making it chain-agnostic
  2. Missing Contract Address: No contract-specific binding prevents cross-contract replay attacks

The hash only includes business logic parameters (_settlementId, _settleInfo, _loanIds, _loans), without any chain-specific binding. When the signature is verified in createSettlement():

Solidity
bytes32 digest = _getSettlementHash(_settlementId, _settleInfo, _loanIds, _loans);
if (!SignatureChecker.isValidSignatureNow(_operator, digest, _signature)) {
    revert InvalidSignature();
}

The signature will validate successfully on any chain where the same data is presented, as the resulting hash would be identical across different networks.

Impact Details

This vulnerability enables the following attack scenario:

  1. Operator signs a valid settlement on Chain A (e.g., Ethereum)
  2. Attacker replays the identical signature and parameters on Chain B (e.g., Polygon, Arbitrum, etc.)

Proof of Concept

Proof of Concep

  1. Setup Environment:
    • Deploy identical Settlement contract on two separate chains (Chain A and Chain B)
    • Use the same operator address for both deployments
    • Distribute test tokens on both chains to the test accounts
  2. Legitimate Transaction (Chain A):
    • Create a valid settlement request with legitimate loan details
    • Structure the settlement with a valid borrower, lender, and loan parameters
    • Have the operator sign this settlement data using their private key
    • Submit the settlement transaction with valid signature on Chain A
    • Verify the settlement is created successfully on Chain A
  3. Extract Transaction Data:
    • Record the exact parameters used for the settlement:
      • Settlement ID
      • SettleInfo struct (taker address, taker type, expiry time)
      • Loan IDs array
      • Loan information array
    • Save the exact operator signature bytes
  4. Execute Replay Attack (Chain B):
    • Switch to Chain B network
    • Use the exact same settlement parameters as on Chain A
    • Use the identical operator signature from Chain A
    • Submit the createSettlement transaction with all copied data
  5. Verify Attack Success:
    • Check that the settlement is successfully created on Chain B
    • Confirm the settlement details match those on Chain A
    • Verify no signature validation errors occurred
    • Observe that the settlement was accepted with the signature from a different chain

The original report as published on Immunefi, by Catchme. 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 signed message hash includes only business parameters and lacks the chain ID and contract address, so it is not bound to a specific chain or contract.

Impact

An attacker could replay a valid operator signature on another chain to create unauthorised settlements, potentially leading to protocol insolvency or theft of user funds.

What the attacker needed

Same contract deployed on multiple chains; Same operator address on both chains; Attacker can observe a valid signature

The fix

The signature hash should include the chain ID and the contract address to bind signatures to a specific chain and contract.

How it was found

  1. Deploy identical Settlement contracts on two chains with the same operator address.
  2. Create a valid settlement on Chain A and have the operator sign it.
  3. Submit the settlement on Chain A and confirm it succeeds.
  4. Record the settlement parameters and the operator signature.
  5. Switch to Chain B and submit the same parameters and signature.
  6. Observe that the settlement is accepted on Chain B.

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.

A signature is like a wax seal proving an operator approved a transaction. Here the seal does not say which blockchain it was made for, so it can be copied and used on a different chain where the same contract exists. This lets someone reuse a valid approval to create a settlement they were not authorised to make on that other chain.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More by Catchme

View all

16 more disclosed reports, best first.

More from Term Structure Institutional

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.