Repository navigation
fix: protect local editor request and update boundaries - #45
Merged
Merged
Conversation
This was referenced Oct 2, 2026
ts-76
marked this pull request as ready for review
October 3, 2026 09:31
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Repo-add UI actions are broken by the new API contract, framing remains exploitable, and one failure path reports contradictory progress.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Strengthens the local editor’s HTTP, filesystem, concurrency, and Apply-reporting boundaries.
Changes:
- Adds loopback, Host/Origin, JSON, size, and static-path validation.
- Serializes Save/Apply operations with cross-process leases.
- Adds sanitized Apply progress reporting and regression tests.
| File | Description |
|---|---|
src/commands/edit.ts |
Secures editor requests, updates, and assets. |
src/commands/apply.ts |
Tracks Apply stages and failures. |
src/commands/apply-progress.ts |
Defines progress types and errors. |
src/commands/sync.ts |
Reports synchronization stages. |
src/cli/main.ts |
Documents allowed loopback hosts. |
test/edit-server.test.ts |
Adds editor security regressions. |
test/command-boundaries.test.ts |
Updates Apply workflow expectations. |
README.md |
Documents editor safeguards and recovery. |
docs/README.ja.md |
Adds Japanese safeguard documentation. |
skills/ghq-sector-cli/SKILL.md |
Updates the editor command example. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Protect local editor request and update boundaries: restrict mutation requests to the same local origin, validate JSON/content type/body size, serialize config changes with an exclusive file lease, and report Apply progress and partial failures accurately. Add frame-ancestors/X-Frame-Options protection to responses. Repo proposals use the current draft contract and return edits without saving.
Closes #42. Standalone UI proposal callers use the new API contract. Apply reports the next stage before reloading config. Tests exercise actual HTTP routes, invalid/oversized requests, competing mutations, framing and partial failures. Existing Copilot findings are fixed and resolved.
Based on merged #44 and #39. Automatic tags/npm publication remain disabled. Validation at
ac2b4b9f295acbc9caebe388e5ae33122f65f6f9: frozen root/UI installs, lint, root/UI TypeScript, 103 CLI/API/release tests, full CLI/UI build and real tarball checks pass. The final merge of landed #44 changed commit ancestry only; its source tree is identical to the tested tree. Root Bun/UI Bun/root npm audits are all 0. Exact-head CI37118590473 and Security37118590474 (audit + CodeQL) both succeed. Fresh Copilot review remains unavailable from the earlier quota exhaustion.