fix: eth_sign's warning and the README say what it signs (closes #409)
eth_sign is signed as an EIP-191 personal message over its data, which is what the Ethereum JSON-RPC specification defines it to return. Its warning on the signature prompt said the site was asking to sign a raw hash that could drain funds, and the README said the same; neither was true. The warning now says the site used the older eth_sign method and that the data will be signed as a personal message, and the README's SignApproval section says so too. Tests pin that the background reads eth_sign address first and data second, and that the sign screen answers it with the personal message signature over the data. Model: opus-5-5
This commit was merged in pull request #545.
This commit is contained in:
@@ -988,9 +988,8 @@ async function handleRpc(method, params, origin) {
|
||||
|
||||
if (method === "eth_sign") {
|
||||
signParams.dangerWarning =
|
||||
"\u26a0\ufe0f DANGER: This site is requesting to sign a raw hash. " +
|
||||
"This can be used to sign transactions that drain your funds. " +
|
||||
"Only proceed if you fully understand what you are signing.";
|
||||
"This site used the older eth_sign method. " +
|
||||
"The data will be signed as a personal message.";
|
||||
}
|
||||
|
||||
if (findPendingApproval(origin, "sign")) {
|
||||
|
||||
@@ -725,7 +725,7 @@ function showSignApproval(details) {
|
||||
"This message is plain text, not hex, so it cannot be signed.";
|
||||
}
|
||||
|
||||
// Display danger warning for eth_sign (raw hash signing)
|
||||
// The warning the background attaches to an eth_sign request.
|
||||
const warningEl = $("approve-sign-danger-warning");
|
||||
if (warningEl) {
|
||||
if (sp.dangerWarning) {
|
||||
|
||||
Reference in New Issue
Block a user