harden: end a site's unremembered connection when its address or wallet is removed (closes #245)
check / check (push) Successful in 2m27s
e2e / e2e-chrome (push) Successful in 4m1s
e2e / e2e-firefox (push) Successful in 3m13s

A site connected without "Remember" lives only in the background's
in-memory connectedSites map. Removing an address or deleting a wallet
dropped the remembered permissions but never told the background; the
entry went only as a side effect of the accountsChanged broadcast, which
empties the whole map when the active address changes.

dropSitePermissions(), shared by both removal paths, now sends
AUTISTMASK_ADDRESSES_REMOVED with the removed addresses, and the
background deletes their entries. Only the extension's own pages may
send it.

Model: opus-5-5
This commit is contained in:
2026-10-04 00:58:47 +00:00
parent 6c70a82de8
commit ed6f403334
6 changed files with 141 additions and 3 deletions
+4 -1
View File
@@ -12,12 +12,15 @@ function sameAddress(a, b) {
return String(a).toLowerCase() === String(b).toLowerCase();
}
// Forget every site permission held against the given addresses.
// Forget every site permission held against the given addresses: the
// remembered ones in `state`, and the connections approved without
// "Remember", which only the background holds, in memory.
function dropSitePermissions(state, addresses) {
for (const addr of addresses) {
delete state.allowedSites[addr];
delete state.deniedSites[addr];
}
notify({ type: "AUTISTMASK_ADDRESSES_REMOVED", addresses });
}
// Remove wallet `walletIdx` from `state` and repair the derived state.