Closed code423n4 closed 1 year ago
Edge case as the policyholder should sign the same data at the same nonce.
Possibly QA
0xSorryNotSorry marked the issue as primary issue
0xrajath marked the issue as sponsor disputed
This is a non-issue since the EIP712_DOMAIN_TYPEHASH
has chainID. This will prevent any cross-chain replay attacks.
gzeon-c4 marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-06-llama/blob/main/src/LlamaCore.sol#L284-L300 https://github.com/code-423n4/2023-06-llama/blob/main/src/LlamaCore.sol#L714-L742
Vulnerability details
Impact
In
LlamaCore.sol
we havecreateActionBySig()
function:This function is for creating an action via an off-chain signature. It checks whether the signature is valid and matches the policyholder's address, and if so, it creates an action.
createActionBySig
call_getCreateActionTypedDataHash()
which generates a unique hash representing a specific action. But in both functions, the signed data doesn't include thechainId
and because of this cross-chain replay attacks are possible.Proof of Concept
From the docs we see:
According to EIP4337 standard to prevent replay attacks the signature should depend on
chainId
. But in these functions,chainId
is not used. A valid signature that was used on one chain could be copied by an attacker and propagated onto another chain.Absolutely the same applies to the functions
castApprovalBySig
andcastDisapprovalBySig
.Tools Used
Manual review
Recommended Mitigation Steps
Add
chainId
increateActionHash()
:Assessed type
Other