Skip to content

Weak / Incorrect Signature Validation

SAFE-0047 Signatures Checked automatically by the scanner
1

What goes wrong

Signature verification mis-orders parameters, hashes the wrong data, accepts arbitrary signers, or does not validate that the recovered signer holds the required role.

2

How to fix it

the pattern that is safe
bytes32 h = keccak256(abi.encode(a, b));        // unambiguous encoding
require(authorized[ECDSA.recover(h, sig)], "unauthorized");
Use abi.encode + role check for signed actions.
Check your own contract for this

The SaferICO scanner runs 201 detectors over your Solidity source, SAFE-0047 among them. Paste an address or the source itself — a small per-scan fee, shown before you sign, or unlimited on any plan.

Run the scanner See how it is attacked Read the docs