Skip to content

Security hardening: same-origin-only local API, 0600 settings, repo cleanup - #118

Draft
shellen wants to merge 1 commit into
mainfrom
security-hardening
Draft

Security hardening: same-origin-only local API, 0600 settings, repo cleanup#118
shellen wants to merge 1 commit into
mainfrom
security-hardening

Conversation

@shellen

@shellen shellen commented Aug 26, 2026

Copy link
Copy Markdown
Owner

From the August 2026 security sweep.

  • Remove Access-Control-Allow-Origin: * from the local viewer server (src/viewer.ts). The API on 127.0.0.1:7777 serves the article library, notes, email settings (including the SMTP password), and LLM config. With the wildcard header, any website open in the user's browser could read and write all of it. Every legitimate client — the Tauri webview (commands.rs loads http://127.0.0.1:{port}) and the browser UI — is same-origin, and same-origin requests never consult CORS, so removing the header changes nothing for the app and only shuts out cross-origin (i.e. hostile) callers.
  • settings.json written with mode 0600 (was world-readable 644) — it holds the SMTP password and any LLM API keys; existing files get chmod'd down on next write.
  • Repo cleanup: untrack .claude/, .pongogo/, .superpowers/, .mcp.json (local files kept; gitignored so they never publish again), delete the wiki/ stub + generated email-header-b64.txt + completed human-needed.md, move two stale root plan docs into docs/plans/.
  • Source-shape tests lock in both invariants. CSP hardening filed separately as Hardening: set a real CSP in tauri.conf.json instead of null #117.

Note: the untracked folders remain in git history (contents reviewed — generic tool instructions and wireframes, no credentials); scrubbing history isn't worth breaking released tags.

Release-notes guidance: per rollout policy, describe this in public release notes only as "performance and security updates" — no exploit details.

Draft — hold for the next release train; do not merge this week.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AdXEsWQTadb9qbTQjLkMqn

…leanup

- Remove Access-Control-Allow-Origin: * from the viewer server. Every
  legitimate client (Tauri webview and browser UI) is served from
  127.0.0.1:7777 itself, so the wildcard only ever served other
  websites' JavaScript — which could read the user's library, notes,
  and stored SMTP/LLM credentials, and write config, from any page
  open in a browser while Pull Read runs. Same-origin requests never
  consult CORS, so nothing legitimate changes.
- Write settings.json (SMTP password, LLM API keys) with mode 0600 and
  chmod existing files down on the next write.
- Untrack local agent/tool state (.claude/, .pongogo/, .superpowers/,
  .mcp.json) and gitignore it — local files kept, just not published.
- Delete the wiki/ stub, generated email-header-b64.txt (email.ts uses
  the .png; regenerable via render-email-header.ts), and the completed
  human-needed.md checklist (RELEASING.md documents the secrets).
- Move stale root plan docs into docs/plans/ with dated names.

Source-shape tests lock in the no-CORS and 0600 invariants. CSP
follow-up filed as #117.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AdXEsWQTadb9qbTQjLkMqn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants