Signatures use only tx ID instead of entire digest
The signature verification functions for fulfilling and cancelling transactions only use the transaction ID and relayer fee, not the full transaction digest. This could allow an attacker to replay an older signature with a different relayer fee if the same transaction ID is reused.
Submitted by cmichel
The signature check in recoverFulfillSignature() only uses transaction ID (along with the relayer fee) which can be accidentally reused by the user, in which case the older signatures with the older relayer fees can be replayed. The signature should be on the entire digest hashInvariantTransactionData(txData) as indicated in the comment on L306.
The impact is that, If the user signatures are indeed on the digest as indicated by the comment, the signature/address check in fulfill() will fail. If not, they may be accidentally/intentionally replayed with same transaction ID, which also appears to be an outstanding question as indicated by the comment on L12.
recoverCancelSignature() similarly uses only tx ID.
Unless there is a good reason not to, it is safer to include hashInvariantTransactionData(txData) in signatures so that they cannot be replayed with different txData (but same tx ID) whose preparedBlockNumber is > 0.
Recommend evaluating if the signature should contain only tx ID, or the entire digest, and then changing the logic appropriately.
LayneHaber (Connext) acknowledged:
User should be able to break up large transfers across multiple routers using the same
transactionIdto keep the transaction unlocking atomic. For example, say I want to transfer $100K, but there are only 8 routers who each have $60K available. I should be able to break up the single transaction into $20K transactions split across 5 of the routers. When unlocking this, I should only need to broadcast a single signature, so all of the transactions can be unlocked simultaneously.
Bumping to medium risk as replay attack can have significant consequences
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
Likely the signature verification functions were designed to allow splitting a transaction across multiple routers using the same transaction ID, but they failed to include the full transaction digest, enabling replay with different transaction data.
Impact
If signatures are on the full digest as intended, the signature check in fulfill() will fail; otherwise, signatures may be replayed with the same transaction ID, potentially allowing an attacker to reuse an old signature with a different relayer fee.
What the attacker needed
Same transaction ID reused; attacker can observe old signature
The fix
The signature should include the entire digest hashInvariantTransactionData(txData) to prevent replay with different transaction data, unless there is a specific reason not to.
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 sign a message to approve a transaction, the signature should cover all the important details so it can't be reused for a different transaction. Here, the signature only covers the transaction ID and a fee, so if the same ID is used again with a different fee, the old signature might still be accepted. This is called a replay attack.
What is Crypto?
Encryption, signatures, randomness or certificate checks that do not protect what they claim to.