security: decrypt and sign dApp approvals in the popup (closes #157)
All checks were successful
check / check (push) Successful in 28s
All checks were successful
check / check (push) Successful in 28s
The dApp transaction and signature approval paths sent the user's plaintext password to the background over runtime.sendMessage and decrypted there. Both now decrypt in the popup, where the password is typed, and put only the signed artifact on the wire: the raw signed transaction, or the signature. Neither the password, the recovery phrase, the xprv nor the private key crosses the messaging boundary any more. This matches what the popup-side eth_sendTransaction path in confirmTx.js already did. The popup runs the same sequence ethers' own sendTransaction() runs internally (populateTransaction, then signTransaction), so nonce, gas, fee and chain id population are unchanged. The background keeps broadcast and approval resolution, and when the popup cannot produce an artifact it reports the error over the same message so the requesting page still gets a failure rather than hanging. Moving the secret out of the background must not turn the background into a blind relay, so it re-derives the signer from the artifact and checks it against the approval it is holding before acting: shared/approvalVerify.js asserts that a raw transaction is the approved transaction signed by the approved address, and that a signature covers the approved payload and recovers to the approved address. A wrong password is now caught in the popup before anything is sent, so it fails with an inline full-sentence error and leaves the pending approval alive to retry; previously it reached the background and destroyed the approval. Rejection still resolves with EIP-1193 code 4001, and approvals still survive popup close and reopen. Removes the four standing TODO(security) markers, now that the flaw is gone.
This commit is contained in:
4
TODO.md
4
TODO.md
@@ -23,6 +23,10 @@ get review, merge to main.
|
||||
|
||||
# Completed Steps
|
||||
|
||||
- 2026-08-09: dApp approval signing moved into the popup — the password no
|
||||
longer crosses the extension messaging boundary; the background broadcasts and
|
||||
resolves approvals only, and verifies the signed artifact against the approval
|
||||
it holds (#157).
|
||||
- 2026-07-07 Adopted scripts-to-rule-them-all: `script/` entrypoints, Makefile
|
||||
shims, README Entrypoints section
|
||||
- 2026-03-01: About well in settings with build info and easter egg (in flight
|
||||
|
||||
Reference in New Issue
Block a user