Skip to content

fix(security): env leak, timer TDZ, symlink escape, xray injection - #85

Merged
huiyu merged 1 commit into
3.0from
fix/security-cluster
Aug 24, 2026
Merged

fix(security): env leak, timer TDZ, symlink escape, xray injection#85
huiyu merged 1 commit into
3.0from
fix/security-cluster

Conversation

@huiyu

@huiyu huiyu commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Security/correctness fixes from the external review of PR #81 — real bugs the unit tests missed.

Regression tests for every case; full suite + generated-drift green. Base 3.0. Resolves the PR #81 env-leak, spawn-failure, symlink, and xray threads.

Relates to #51 #68

…ection

Addresses the security/correctness findings from the external review of PR #81.

- **CRITICAL (#51)** cross-review no longer forwards the whole process.env to the
  reviewer subprocess (it held API tokens visible in the invocation and any log).
  buildInvocation now copies a strict allowlist (PATH/HOME/locale…) plus the
  recursion guard and auth home; `plan` prints only env KEY NAMES, never values.
- **#51** runner: a synchronous spawn failure hit a timer temporal-dead-zone and
  threw ReferenceError instead of the typed fallback — the timer binding is now
  declared before `done`. A non-zero reviewer exit is a fallback, not trusted
  output.
- **#68** store: `writeKind` resolves the real path and rejects a `registry` dir
  that symlinks outside the repo, so an approved write can never land elsewhere.
- **#68** xray: baseUrl is parsed and restricted to a clean https origin+path
  (no userinfo/query/fragment); `since` and the record's `updated` must be ISO
  instants; a record key must be PROJECT-NNN — closing the JQL-injection and
  malformed-record surfaces.
- Regression tests for each (env allowlist, sync-spawn fallback, non-zero exit,
  symlink escape, URL/since/record validation).

Relates to #51 #68. Resolves the PR #81 env-leak, spawn-failure, symlink, and
xray review threads.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KwyFyRC6pepaK6DuMK7YeT
@huiyu
huiyu merged commit 879c310 into 3.0 Aug 24, 2026
1 check passed
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