security: announce a fresh EIP-6963 provider UUID per page load (closes #398)
The provider UUID was generated once, stored in extension storage, and announced verbatim to every page on every load and across restarts, so any site — connected or not — could read a stable cross-site, cross-session identifier for the install: a supercookie contradicting the "no tracking" promise. EIP-6963 wants a fresh UUIDv4 per announcement instead. inpage.js now announces a per-load crypto.randomUUID() and persists nothing; the eip6963Uuid storage key and the AUTISTMASK_PROVIDER_UUID content-script message are removed. That key was a standalone top-level storage entry, never part of the versioned autistmask profile, so stateSchema.js and the persisted-field harness are untouched and no existing profile is affected. A jest test asserts two loads announce different UUIDv4s and that one load reuses a single UUID across re-announcements. Model: opus-4-8
This commit is contained in:
+8
-11
@@ -204,7 +204,14 @@
|
||||
"</svg>",
|
||||
);
|
||||
|
||||
let providerUuid = crypto.randomUUID(); // fallback until real UUID arrives
|
||||
// EIP-6963 wants a fresh UUIDv4 per page load — it identifies one
|
||||
// announcement, so a provider can be told apart from another instance of
|
||||
// itself in the same page. It is generated here and never stored:
|
||||
// announcing one persisted value to every site, on every load and across
|
||||
// restarts, turned it into a stable cross-site, cross-session tracking
|
||||
// identifier any page could read
|
||||
// (https://git.eeqj.de/sneak/AutistMask/issues/398).
|
||||
const providerUuid = crypto.randomUUID();
|
||||
|
||||
function buildProviderInfo() {
|
||||
return {
|
||||
@@ -226,16 +233,6 @@
|
||||
);
|
||||
}
|
||||
|
||||
// Listen for the persisted UUID from the content script
|
||||
function onProviderUuid(event) {
|
||||
if (event.source !== window) return;
|
||||
if (event.data?.type !== "AUTISTMASK_PROVIDER_UUID") return;
|
||||
window.removeEventListener("message", onProviderUuid);
|
||||
providerUuid = event.data.uuid;
|
||||
announceProvider();
|
||||
}
|
||||
window.addEventListener("message", onProviderUuid);
|
||||
|
||||
window.addEventListener("eip6963:requestProvider", announceProvider);
|
||||
announceProvider();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user