Repository navigation
fix: CodeCora scan triage — 8 MAJOR findings fixed, hardening + tests - #92
Merged
Merged
Conversation
Full cora scan (54 files, 2026-09-18) reported 10 MAJOR findings; all
10 validated against the code, 9 real. This PR fixes them:
- openai: derived Debug printed api_key in cleartext via {:?} — manual
redacting impl (safe_description stays the explicit form) + test.
- uteke: recall query could inject CLI flags (leading-dash guard, same
defense as the room check) + test; room-link spawn skipped
scrub_env_for_child (ENV-1) — scrubbed.
- jobs: job_poll (ReadOnly) truncated/rewrote the job log on poll —
the write-back is gone; bounded tail read only (risk-tier invariant
outweighs the disk-space convenience; JOB-2 OOM protection stays) +
updated test asserts non-mutation.
- subprocess: capture capped at 32 MiB per stream with a marked
truncation suffix (unbounded read_to_end allowed memory exhaustion);
drain no longer joins unconditionally — a grandchild holding the pipe
gets a 2s grace, then the agent proceeds (leaked-but-doomed reader
beats an unbounded hang; unterminated output dropped, documented);
run_with_timeout_stdin's writer join got the same grace (caught by
cora review on this very PR).
- subprocess argv scan: sh -c payloads now get full scan() recursion
AND keep the conservative whole-payload match — path-qualified
programs (sh -c "/bin/rm -rf /"), nested shells, and quoted tokens
('rm -rf /') are refused; compound statements still caught. +tests.
- gh: pr_create advertised 'head' but argv silently dropped it — PRs
could open from the wrong branch; now passed and validated like base
+ tests.
- docs: architecture.md Destructive row contradicted the
never-allowlistable invariant — corrected.
The 10th MAJOR (mcp single-oversized-block cap) is fixed too, via an
incremental pure cap_text_blocks helper + tests. Deferred MINOR/INFO
findings are listed in the PR body for follow-up.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Sep 28, 2026
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.
What
Full
cora scan(54 files, first successful full-codebase scan) reported 68 findings (10 MAJOR / 44 MINOR / 14 INFO). All 10 MAJORs validated against the code — 10/10 real; this PR fixes them all with regression tests, plus the doc contradiction.Why
AGENTS.md/CONTRIBUTING mandate
cora scanafter significant changes; the first full scan surfaced one real credential-leak channel, two argv/spawn-hygiene gaps, a ReadOnly tool that mutated files, unbounded memory/blocking in the subprocess primitive, and a silent no-op in gh pr_create.Changes (all MAJORs, each with tests unless noted)
openai: derivedDebugprintedapi_keyvia{:?}→ manual redacting impluteke: recall query could inject CLI flags (leading-dash guard); room-link spawn skippedscrub_env_for_child(ENV-1)jobs:job_poll(ReadOnly) truncated/rewrote the log — write-back removed, bounded tail read only (behavior change: runaway logs are no longer trimmed on poll; clearing is an operator action)subprocess: capture capped at 32 MiB/stream with marked suffix; drain uses a 2s grace instead of an unbounded join when a grandchild holds the pipe (unterminated output dropped, documented);sh -cpayloads get full scan() recursion + quote stripping (/bin/rm -rf /, nested shells, quoted tokens refused) while keeping the conservative compound-payload matchgh:pr_createnow passes the advertisedhead(validated likebase)mcp: result cap applied incrementally (single oversized block no longer defeats it) via purecap_text_blocks+ testsDeferred (MINOR/INFO, 50+ items — mostly test hygiene, perf nits, non-unix paths, doc drift)
Notable: resume-with-prompt never stores the memory summary; failed startup leaves a stray empty session file;
scrub()mangles text on empty secret;trim_end_matches(".jsonl")repeated-suffix bug; non-unix write path TOCTOU. Will file as a tracking issue on request — flagging here first per the issue-approval convention.Testing