To be clear, these are the problematic lines of code in every version of Safe's multi-signature upgradeable proxy contracts (specifically their
singleton/masterCopy/implementation deployment; the Fallback and Factory contracts are not impacted):
solidity
} else if (v > 30) {
// To support eth_sign and similar we adjust v and hash the messageHash with the Ethereum message prefix before applying ecrecover
currentOwner = ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", dataHash)), v - 4, r, s);
} else {
// Use ecrecover with the messageHash for EOA signatures
currentOwner = ecrecover(dataHash, v, r, s);
}
These faulty lines of code are in every single deployed
Safe (masterCopy/singleton/implementation) contract for each version release of Safe. Specifically, I'm referring to (contracts for those addresses on Ethereum / main net):
A) Version 1.1.1 =
0x34CfAC646f301356fAa8B21e94227e3583Fe3F5FB) Version 1.2.0 =
0x6851D6fDFAfD08c0295C392436245E5bc78B0185C) Version 1.3.0 =
0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552D) Version 1.4.0 =
0x29fcB43b46531BcA003ddC8FCB67FFE91900C762EIP-191 is a standard for verifying personal sign messages. Its outlined fairly thoroughly here: https://eips.ethereum.org/EIPS/eip-191EIP-712 is a signature standard for verifying transaction data. That, too, is outlined very thoroughly here: https://eips.ethereum.org/EIPS/eip-712 .
The screenshot attached to this message shows how wallets that employ the
EIP-712 standard are supposed to correctly dissect and display EIP-712 encoded transaction data for end users when their signature is being requested for said data (usually by a DApp or web3 app of some sort). That screenshot provides a rough reflection of what the owners of the Bybit exchange were looking at before they signed whatever transaction resulted in $1.5 billion in funds being compromised. (However this is not an indictment of those exchange owners by any means)
