fix: hygiene + security follow-ups (closes #33, #34, #35, #39)#40
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…fill namespace; drop @types/chrome Replaces all type-position chrome.bookmarks.* and chrome.runtime.* references in extension-shared src and tests with Bookmarks.*/Runtime.* from webextension-polyfill. Adds test/globals.d.ts to declare the chrome global for the test stub without @types/chrome. Drops @types/chrome devDep and the "chrome" types entry from tsconfig.json across extension-shared, -chrome, and -firefox. Zero runtime changes; 283 tests still green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tion calls Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ifests Adds CSP meta tag to the web UI (connect-src restricted to api.github.com, no unsafe-eval, frame-ancestors none) and pins content_security_policy in both Chrome and Firefox MV3 manifests (script-src/object-src 'self' + connect-src https://api.github.com).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Guard both the create and edit paths in applyRemoteChanges against javascript:, data:, vbscript: and other unsafe URL schemes using isSafeBookmarkUrl from @gitmarks/core. Tombstones are exempted so soft-deletes still propagate even if the stored URL is malformed. applyRemoteEdit also gains a belt-and-suspenders early-return. Adds 2 new tests (extension-shared now 100). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Update CLAUDE.md and README.md with current test counts (core: 77, extension-shared: 100, web: 109, total: 286) and add four new load-bearing invariant bullets documenting the URL safety filter, remote file Zod re-validation, tag color guard, and CSP posture established by the hygiene-and-hardening PR. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rop dead inner guard Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…'self' in CSP, copy-html per-file check, sign-out disabled during in-flight writes
Review-driven fixes — 13 of 15 findings addressed
Deferred (DX only, not bugs):
Test posture: 294 unit + component tests (77 core + 108 ext-shared + 109 web), typecheck + build clean on all 5 packages. Verified REFUTED during review (not bugs):
|
Browser smoke test — all checks passPlaywright e2e (`pnpm --filter @gitmarks/extension-chrome e2e`): 4 passed, 2 skipped (same posture as before the PR — no regressions). The renamed `pree2e` hook fired correctly: `[chrome] copied popup.html + options.html from extension-shared` appeared before vite build, confirming the colon-script-hook fix landed. Web UI (`pnpm --filter @gitmarks/web build && vite preview` against http://localhost:4173/):
Test plan now:
Three smoke-test screenshots delivered out-of-band: setup page → list page (note the italic non-clickable EVIL row) → post-sign-out setup page. |
Summary
Closes #33, #34, #35, #39.
Test plan
Implementation notes
🤖 Generated with Claude Code