-
Notifications
You must be signed in to change notification settings - Fork 20.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
eth_sign: JSON RPC spec and Go API are not conform #2397
Comments
Thank you for reporting this. There are at the moment two issues:
|
Implementation fixed. See linked PR. Will address the spec soon. |
Thank you! |
its important that the the danger of passing in just a hash is that it could be the hash of a tx that the user is not aware the are signing for I think the specification was designed with this in mind, and @obscuren's assumption that it implied that the data should directly be signed ( instead of the hash of the data ) was incorrect |
Feeding the message into the signing function without hashing allows extraction of the private key. |
A better fix would be to deprecate eth_sign and create a new method, perhaps personal_sign, that hashes the passed message prior to signing it. |
I would argue that not sending hashes but clear text to a (remote) rpc-node would also raise privacy concerns. Maybe eth_sign could sign a sent hash together with a random salt and return signature and salt? What if a user wants to sign a gigabyte large file? I would not send this to the RPC. |
personal_sign is being added in #2940. |
@Georgi87 im not sure in what case you would be doing this, unless that remote node held your private key, in which case you've got nothing to hide from it. |
Agreed @kumavis |
The JSON-RPC interface describes that the data returned from the eth_sign call is the signed data while the go implementation signs a hash of the data:
https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign
Go:
https://github.com/ethereum/go-ethereum/blob/develop/eth/api.go#L1108
The text was updated successfully, but these errors were encountered: