fix: low-severity security findings L3, L4, L5 (closes #6) #8

Merged
sneak merged 7 commits from fix/low-severity-security into main 2026-02-27 23:19:09 +01:00
2 changed files with 7 additions and 5 deletions
Showing only changes of commit 27f16191b4 - Show all commits

View File

@@ -26,7 +26,7 @@ if (typeof browser !== "undefined") {
uuid = crypto.randomUUID();
storage.set({ eip6963Uuid: uuid });
}
window.postMessage({ type: "AUTISTMASK_PROVIDER_UUID", uuid }, "*");
window.postMessage({ type: "AUTISTMASK_PROVIDER_UUID", uuid }, location.origin);
});
})();

View File

@@ -9,7 +9,7 @@
const pending = {};
// Listen for responses from the content script
window.addEventListener("message", (event) => {
window.addEventListener("message", function onUuid(event) {
if (event.source !== window) return;
if (event.data?.type !== "AUTISTMASK_RESPONSE") return;
const { id, result, error } = event.data;
@@ -24,7 +24,7 @@
});
// Listen for events pushed from the extension
window.addEventListener("message", (event) => {
window.addEventListener("message", function onUuid(event) {
if (event.source !== window) return;
if (event.data?.type !== "AUTISTMASK_EVENT") return;
const { eventName, data } = event.data;
@@ -178,12 +178,14 @@
}
// Listen for the persisted UUID from the content script
window.addEventListener("message", (event) => {
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();