Where.src/background/index.js:259-265 (extractHostname), 621-640
(handleConnectionRequest checks allowedSites/deniedSites by hostname) and 1097-1102 (accountsChanged uses the same hostname match). Remembered
permissions live in state.allowedSites / deniedSites keyed by hostname;
in-memory session connections are keyed by full origin.
What is wrong. A permission granted to https://dapp.example is honoured for http://dapp.example and for any port on that host, because only the hostname is
stored and compared. The approval and signing prompts display the hostname only,
so the user cannot see the scheme.
Why it matters. A network attacker who can serve a cleartext page for a host
the user has connected to over https inherits the connection and can raise
signing prompts under the trusted name.
Reproduction. Connect to https://dapp.example with Remember; later load http://dapp.example (for example via a network attacker); eth_accounts
returns the address with no prompt, and eth_sendTransaction opens a prompt
naming dapp.example.
Acceptable. Key remembered permissions by full origin (scheme://host[:port])
and show the origin (at least the scheme) on all three prompts; migrate existing
hostname entries.
Definition of done.
Remembered permissions are stored and matched by full origin.
The connection, transaction and signature prompts display the origin, not
the bare hostname.
Existing hostname-keyed entries are migrated (for example treated as https
origins) so no grant is lost silently.
A test asserts an https grant does not authorise the http origin of the
same host.
Model: fable-5-1 (review); opus-4-8 (filing)
Severity: hardening.
**Where.** `src/background/index.js:259-265` (`extractHostname`), `621-640`
(`handleConnectionRequest` checks `allowedSites`/`deniedSites` by hostname) and
`1097-1102` (`accountsChanged` uses the same hostname match). Remembered
permissions live in `state.allowedSites` / `deniedSites` keyed by hostname;
in-memory session connections are keyed by full origin.
**What is wrong.** A permission granted to `https://dapp.example` is honoured for
`http://dapp.example` and for any port on that host, because only the hostname is
stored and compared. The approval and signing prompts display the hostname only,
so the user cannot see the scheme.
**Why it matters.** A network attacker who can serve a cleartext page for a host
the user has connected to over https inherits the connection and can raise
signing prompts under the trusted name.
**Reproduction.** Connect to `https://dapp.example` with Remember; later load
`http://dapp.example` (for example via a network attacker); `eth_accounts`
returns the address with no prompt, and `eth_sendTransaction` opens a prompt
naming `dapp.example`.
**Acceptable.** Key remembered permissions by full origin (`scheme://host[:port]`)
and show the origin (at least the scheme) on all three prompts; migrate existing
hostname entries.
**Definition of done.**
- [ ] Remembered permissions are stored and matched by full origin.
- [ ] The connection, transaction and signature prompts display the origin, not
the bare hostname.
- [ ] Existing hostname-keyed entries are migrated (for example treated as https
origins) so no grant is lost silently.
- [ ] A test asserts an https grant does not authorise the http origin of the
same host.
Model: fable-5-1 (review); opus-4-8 (filing)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Severity: hardening.
Where.
src/background/index.js:259-265(extractHostname),621-640(
handleConnectionRequestchecksallowedSites/deniedSitesby hostname) and1097-1102(accountsChangeduses the same hostname match). Rememberedpermissions live in
state.allowedSites/deniedSiteskeyed by hostname;in-memory session connections are keyed by full origin.
What is wrong. A permission granted to
https://dapp.exampleis honoured forhttp://dapp.exampleand for any port on that host, because only the hostname isstored and compared. The approval and signing prompts display the hostname only,
so the user cannot see the scheme.
Why it matters. A network attacker who can serve a cleartext page for a host
the user has connected to over https inherits the connection and can raise
signing prompts under the trusted name.
Reproduction. Connect to
https://dapp.examplewith Remember; later loadhttp://dapp.example(for example via a network attacker);eth_accountsreturns the address with no prompt, and
eth_sendTransactionopens a promptnaming
dapp.example.Acceptable. Key remembered permissions by full origin (
scheme://host[:port])and show the origin (at least the scheme) on all three prompts; migrate existing
hostname entries.
Definition of done.
the bare hostname.
origins) so no grant is lost silently.
same host.
Model: fable-5-1 (review); opus-4-8 (filing)