TitlesGraph has a checkSignature modifier used to check the signature for a proxied acknowledgment in TitlesGraph.acknowledgeEdge() and TitlesGraph.unacknowledgeEdge().
/// @notice Modified to check the signature for a proxied acknowledgment.
modifier checkSignature(bytes32 edgeId, bytes calldata data, bytes calldata signature) {
bytes32 digest = _hashTypedData(keccak256(abi.encode(ACK_TYPEHASH, edgeId, data)));
if (
!edges[edgeId].to.creator.target.isValidSignatureNowCalldata(digest, signature)
|| _isUsed[keccak256(signature)]
) {
revert Unauthorized();
}
_;
_isUsed[keccak256(signature)] = true;
}
However, it is vulnerable to cross-chain replay attacks because it doesn't check for chainId in the current implementation as specified by the Solady SignatureCheckerLib doc:
/// WARNING! Do NOT use signatures as unique identifiers:
/// - Use a nonce in the digest to prevent replay attacks on the same contract.
/// - Use EIP-712 for the digest to prevent replay attacks across different chains and contracts.
/// EIP-712 also enables readable signing of typed data for better user safety.
/// This implementation does NOT check if a signature is non-malleable.
Impact
Signature replay attack leading to unfair authorized calls to acknowledgeEdge() / unacknowledgeEdge().
nisedo
medium
Cross-Chain Signature Replay Attack in
TitlesGraph.checkSignature()
Summary
TitlesGraph.checkSignature()
doesn't check for chainId allowing for cross-chain signature replay attacks.Vulnerability Detail
The protocol is meant to be deployed on multiples chains according to the README:
TitlesGraph has a
checkSignature
modifier used to check the signature for a proxied acknowledgment inTitlesGraph.acknowledgeEdge()
andTitlesGraph.unacknowledgeEdge()
.However, it is vulnerable to cross-chain replay attacks because it doesn't check for
chainId
in the current implementation as specified by the Solady SignatureCheckerLib doc:Impact
Signature replay attack leading to unfair authorized calls to acknowledgeEdge() / unacknowledgeEdge().
Code Snippet
Tool used
Manual Review
Recommendation
Add a
chainId
check in thecheckSignature
modifier.Duplicate of #284