Repository navigation
Done
Labels
enhancementNew feature or request
Description
From a re-audit of main at bd39ce8. Hardening items for the NIP-07 consent path, most useful first.
What holds: auto-sign defaults off; approval windows deny on timeout; the popup renders origins with no HTML injection; iframes get neither the provider nor the interceptor; there is no external messaging surface.
- The service worker trusts
message.origin(src/background.js:117,:127-157; stamped atsrc/injected.js:166). The sidestr path already takes it fromsender(pageOrigin,src/background.js:215), though that helper still falls back to the claimed value. Fix: usesender.origin, requiresender.frameId === 0, dropmessage.origin. - The signing prompt hides what is signed (
src/background.js:362-367). It shows a tag count and the first 200 characters of content. For kind 27235 the meaning is entirely in theuandmethodtags; for kind 5 and kind 3 it is in which events are deleted or which follows are replaced. Fix: show the tags, scrollable; for 27235 make method and URL the headline. - One approval grants everything, with no expiry (
src/background.js:316-328,:356-377,:410-417). ApprovinggetPublicKeytrusts the origin for every event kind and for NIP-44 encrypt and decrypt. Deliberate since 0.0.8 and disclosed in the prompt (popup/approve.html:151), but worth narrowing: separate scopes for public key, signing (optionally per kind) and decrypt. - The opaque origin
"null"can be trusted (src/injected.js:166,src/storage.js:162).file://pages and sandboxed documents all report it. Fix: refuse opaque origins. - Unlock is requested before consent (
src/background.js:313,:343,:408). An untrusted page can keep opening the unlock window, and can tell "locked" from "no key" by the error text (:285against:287). Fix: trust check and prompt first, unlock after. - No limit on approval windows (
src/background.js:607-643). Fix: one pending prompt per origin, and a cool-down after a deny. - The key is read before the prompt (
src/background.js:345), so locking Podkey while a prompt is open does not stop that signature. Fix: read it after approval. - Message classes are open by default.
APPROVE_SIGNINGhas no sender check (src/background.js:53-60), and the unusedNIP44_GET_CONVERSATION_KEYhandler (src/background.js:156) returns a long-term per-peer key and is guarded only by the content script's allowlist. Fix: delete the dead handler; require an extension-page sender forAPPROVE_SIGNING; make the page / extension-UI classification explicit and closed by default. - Closed approval windows are detected by
beforeunloadonly (popup/approve.js:70); spends already usechrome.windows.onRemoved. Fails closed after 60 s today. - Long origins scroll inside an 84px badge (
popup/approve.css:76-92), which can push the registrable domain out of view.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
jjohare commentedon Nov 28, 2026
Addressed in 0.0.12 and 0.0.13 (a2265b7): the asking site comes from Chrome's sender; message types are classified with anything else refused; only the tick-box trusts a site; prompts come one per site with a pause after a no; consent comes before unlock and an unapproved site hears one answer whether Podkey is locked or has no key; the key is read after approval; the approval window keeps the worker alive; long origins wrap; closing the window denies; events are previewed. Approval scopes are #44; what an unapproved site can still learn is in #47.