Skip to content

Commit 19e1d63

Browse files
authored
Enhance Safe.sol with ECDSA malleability warning (#877)
Added a comment in the Safe contract to clarify that the `s` value of ECDSA signatures is not enforced to be in the lower half of the curve. This note explains the implications of ECDSA malleability and reassures that existing mechanisms are in place to prevent duplicate signatures and replay attacks. No functional changes were made to the contract logic.
1 parent 8aa4551 commit 19e1d63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

contracts/Safe.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ contract Safe is
291291
address currentOwner;
292292
uint256 v; // Implicit conversion from uint8 to uint256 will be done for v received from signatureSplit(...).
293293
bytes32 r;
294+
// NOTE: We do not enforce the `s` to be from the lower half of the curve
295+
// This essentially means that for every signature, there's another valid signature (known as ECDSA malleability)
296+
// Since we have other mechanisms to prevent duplicated signatures (ordered owners array) and replay protection (nonce),
297+
// we can safely ignore this malleability.
294298
bytes32 s;
295299
uint256 i;
296300
for (i = 0; i < requiredSignatures; i++) {

0 commit comments

Comments
 (0)