OpenZeppelin Contracts ECDSA bug
38 / Investigating the ECDSA bug in OpenZeppelin Contracts and searching for vulnerabilities in smart contracts. Will a zero day be found?
Timeline
14:47
Searching for vulnerabilities in the wild
15:09
Searching with Etherscan
19:47
Found it in the mock
Participants
Episode notes
Edit these notes…
- What is ECDSA?
- A public key and a private key
- Can be Eth address
- Sign a message with a private key, and anybody can verify against public key
- Sign a Eth TX or message
- The messages are used on smart contracts to denote authorization
- Encrypt message with a public key, and decrypt with a private key
- Two types of encoding, 64-byte and 65-byte
- Either is accepted for verification in a smart contract
- ECDSA signature malleability · Advisory · OpenZeppelin/openzeppelin-contracts https://github.com/OpenZeppelin/openzeppelin-contracts/secur lity/advisories/GHSA-4h98-2769-gh6h
- OZ mentioned
ecrecover opcode malleability
- OZ failed to mention the 64/65-bit malleability
- Reported other contracts affected ERC1271WalletMock and EIP712External
- Should make signature acceptance injective rather than surjective
- Need better code search for live contracts!
- At least github search accepts “-” operators
- Potential issues with Github search operators for Stars & Forks
- Found a vulnerability in Zibert bridge (created Github issue) and Hive https://github.com/cent-inc/hive/issues/1