Signature Malleability Explained in Detail
Signature malleability means one valid signature can be transformed into another valid signature for the same message. In ECDSA, high-s variants are the classic concern.
Modern libraries usually reject malleable forms, but raw ecrecover usage can still be risky.
Smart contract example
address signer = ecrecover(digest, v, r, s);
Raw recovery needs extra checks for zero address, valid v, and low s.
Signature Malleability in Auditing
Malleability can break replay protection if a contract tracks used signatures by raw signature bytes. An attacker may submit a different byte representation for the same message.
Auditors review signature validation and used-state tracking.
Red flags in code
-
Raw
ecrecoveris used without low-schecks. -
Both
vformats are accepted inconsistently. -
Used signatures are tracked by signature bytes instead of digest or nonce.
-
Zero-address signer is accepted.
-
Signature checks do not use a reviewed ECDSA library.
How to test or review it
-
Submit high-
sand low-svariants where possible. -
Test
vvalues27,28,0, and1according to expected rules. -
Replay the same digest with altered signature bytes.
-
Track used authorizations by nonce or digest.
-
Prefer audited ECDSA helpers for signature recovery.
Keep learning this topic
ecrecover
ecrecover is Solidity's interface to the EVM precompile for recovering an Ethereum address from a secp256k1 signature over a 32-byte hash.
Signature Replay
Signature replay happens when a valid signature can be reused more than once or reused in a different context than the signer intended.
EIP-712
EIP-712 is a standard for signing typed structured data so a signature is bound to a specific message type and domain.
Practice this in real audit scenarios
Definitions help, but auditors need reps. SCH turns concepts like Signature Malleability into exploit labs, code review habits, and report-writing practice.
Start the free trial or see the full smart contract auditing course.