Repository navigation
fix(security): ADR task records stay inside the wiki root (GHSA-5w3v-7v7h-q9x4) - #941
Conversation
# Conflicts: # mcp_server/handlers/auto_task_record_writer.py
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @cdeust's task in 2m 43s —— View job PR #941 review (1 of 3): done
The reviews found no Blockers. The containment fix is complete for an MCP caller:
The review comment lists three Notes that need no action before merge:
I traced the code but did not run the tests. Verdict: approve |
Review 1 of 3: PR #941 (GHSA-5w3v-7v7h-q9x4)Five foreground reviews ran: security, code quality, test coverage, documentation accuracy and performance. None found a Blocker. Reviewed at Security (traced, not run): the fix is complete for an MCP caller.
Tests:
Notes, no action before merge
Verdict: approve |
…w3v-7v7h-q9x4) Mutation gate on #941: 3 survivors replaced the escape message (None, wrapped, upper case) and 2 the 'unknown' fallback of an explicit domain that sanitizes to nothing. The tests now check the reported reason exactly and that '..', '../..' and '///' resolve to 'unknown'. Local gate (PostgreSQL 18.6): 0 judged survivors in both files.
|
Claude finished @cdeust's task in 1m 37s —— View job PR #941 review (2 of 3): done
None of the reviews found a Blocker. The new assertions match what the writer actually returns, The review comment lists two Notes that need no action before merge:
Verdict: approve |
|
Review 2 of 3: PR 941 (GHSA-5w3v-7v7h-q9x4) Earlier Blockers: review 1 ( Scope: the only commit since
I traced the code but did not run pytest or ruff: this environment needs approval for those commands. Notes, no action before merge
Verdict: approve |
…tainment # Conflicts: # CHANGELOG.md
|
Claude finished @cdeust's task in 1m 27s —— View job PR #941 review (3 of 3): done
Accepted: the whole PR, all 4 files. No file or commit has an open Blocker, so nothing needs a refinement PR. The review comment lists three Notes that need no action before merge. I traced the code but did not run pytest or ruff. Verdict: approve |
Review 3 of 3: PR #941 (GHSA-5w3v-7v7h-q9x4)Earlier Blockers: reviews 1 ( Scope: one commit landed after
I traced all of this but did not run pytest or ruff. When I posted this, the Accepted: the whole PR, all 4 files: Notes, no action before merge
Verdict: approve |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 03bf3d80fa
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
| adr_num = _next_adr_number(wiki_root, domain) | ||
| record = build_task_record(inputs, adr_number=adr_num) | ||
| page_path = wiki_root / record.suggested_path | ||
| page_path = (wiki_root / record.suggested_path).resolve() |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Security: Preserve private mode when resolving the wiki path
When the global wiki path is a symlink to a group/world-readable directory, resolving the destination here before gated_files.write_text removes the lexical ~/.claude/methodology prefix used by is_private. The gate then creates auto-ADRs as 0666 minus umask—0644 under 022—whereas the parent revision wrote 0600, allowing another local account to read commit and memory excerpts through the physical target. Preserve the private classification or pass mode 0600 explicitly after containment validation.
SECURITY.md reference: SECURITY.md:L5-L16
Useful? React with 👍 / 👎.
Fix for GHSA-5w3v-7v7h-q9x4 (accepted, CVE requested). The advisory is published with 4.24.0. The fix was written by the reporter, kasparovabi, in the advisory's private fork. It is brought up to date with
mainhere: the writer now goes throughgated_files.write_text, and the containment check sits before that call.record_session_end._resolve_domainpasses an explicitdomainthroughdomain_id_from_label.auto_task_record_writerrefuses a record path that resolves outsideWIKI_ROOT.tests_py/handlers/test_auto_task_record_writer_containment.pycovers a traversal domain, a symlinked domain directory and path-like variants. It fails 8 of 9 on the unfixed code and passes 9 of 9 with the fix. The 28record_session_endandauto_task_recordtests pass.ruff: clean;check_craftsmanship.py: OK.