bdecd747802f
L2/SEC-004: check event.source in passkey toast closed listener
- time
- 2026-05-16 04:32 UTC · 5 months ago
- machine
- koh2
- parent
- d99374a2ca9b
↓ peach-browser-bdecd747.tar.gzatlas at this save
files changed1 file
src/content/index.ts+3 −0src/content/index.ts+3 −0
@@ -968,6 +968,9 @@968968 // inject.tsx posts this when the passkey toast closes (approve, deny, or timeout)969969 // so we know it's safe to allow autofill again.970970 window.addEventListener("message", (e: MessageEvent) => {971+ // Reject postMessages from cross-frame senders — only the same window's972+ // injected toast may flip this flag.973+ if (e.source !== window) return;971974 const d = e.data as { source?: string; type?: string } | undefined;972975 if (d?.source === "peach-passkey-toast" && d?.type === "toast-closed") {973976 passkeyToastActive = false;