Skip to content

[codex] Harden live mode helper security#186

Draft
inbusiness23 wants to merge 1 commit into
pbakaus:mainfrom
inbusiness23:codex/security-hardening-live-mode
Draft

[codex] Harden live mode helper security#186
inbusiness23 wants to merge 1 commit into
pbakaus:mainfrom
inbusiness23:codex/security-hardening-live-mode

Conversation

@inbusiness23

Copy link
Copy Markdown

Summary

  • require the live-mode session token before serving /live.js
  • restrict CORS to the origin that loaded the tokened live script
  • keep source reads and explicit helper file paths inside the project root
  • cap JSON request bodies and harden copy-edit agent subprocess defaults
  • regenerate provider skill copies from the build pipeline

Why

A security review found that live mode treated localhost as the trust boundary. Any unrelated local page or process could load /live.js, wildcard CORS allowed broad cross-origin access, /source used a fragile prefix check, JSON bodies were unbounded, and copy-edit subprocesses defaulted to permission-bypass flags with the full environment. This PR tightens those local live-mode boundaries while preserving the existing workflow.

Validation

  • bun install --frozen-lockfile
  • npm run build
  • node --check skill/scripts/live-server.mjs skill/scripts/live-inject.mjs skill/scripts/live-copy-edit-agent.mjs skill/scripts/live-wrap.mjs skill/scripts/live-insert.mjs skill/scripts/live-browser.js
  • node --test tests/live-server.test.mjs tests/live-inject.test.mjs tests/live-insert.test.mjs tests/live-wrap.test.mjs tests/live-copy-edit-agent.test.mjs tests/framework-fixtures.test.mjs
  • git diff --check

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.

1 participant