Repository navigation
harden(security-core): fix 7 audit findings — integrity fail-closed, env-strip gaps, supply-chain fail-closed - #101
Merged
Merged
Conversation
…in gate (G1 #100) Fixes the G1 group of the Codex security audit (#100). integrity: NoBaseline fails CLOSED runtime_check() now returns Err on IntegrityStatus::NoBaseline instead of silently continuing. A hook with a deleted .rtk-hook.sha256 baseline cannot be verified and deleting the baseline is itself a plausible tamper step. Error tells the user to re-baseline via `contextcrawler init -g --auto-patch`. NotInstalled/Verified paths unchanged. integrity: baseline-trust guard Before trusting the baseline sidecar, verify_hook_at() now rejects a symlinked baseline (all platforms) and, on Unix, a baseline that is group/world-writable or owned by another uid (MetadataExt + geteuid). Scoped fix — the store is not relocated. integrity: recovery text rebranded runtime_check() Tampered recovery output now emits `contextcrawler init` / `contextcrawler verify` instead of `rtk ...`. secure_git_command: arg/config hardening --config-env (env-injection RCE flag) added to the forbidden-flag set in both exact and prefix forms. Exec-capable config families added to the forbidden config-key prefixes: alias., credential., filter. secure_cargo_command: CARGO_ENCODED_RUSTFLAGS Added to FORBIDDEN_CARGO_ENV_EXACT — it is the higher-precedence sibling of RUSTFLAGS, so stripping only RUSTFLAGS left a hole. secure_node_command: NODE_PATH Added to NODE_ENV_VARS_EXACT — prepended module-resolution dirs let a planted module shadow a real dependency. supply_chain_gate: fail CLOSED on Unavailable rewrite_cmd::run() now downgrades the auto-allow to Ask (exit 3) on Verdict::Unavailable, not just Verdict::Block. A registry timeout / OSV outage / TOML-parse error no longer waves installs through silently. The gate is opt-in, so once enabled it fails closed. Block behaviour unchanged. Tests added for each finding. Addresses the G1 portion of #100. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Codex review of the G1 hardening: check_baseline_trust rejected any baseline not owned by the running euid — which breaks the system-wide install pattern where the baseline is root-owned and a non-root user legitimately cannot own it. Accept owner == euid OR owner == 0; root ownership is strictly harder for an unprivileged attacker to forge.
This was referenced May 20, 2026
noogalabs
pushed a commit
to noogalabs/contextcrawler
that referenced
this pull request
Jun 4, 2026
* feat(docker): add docker compose support with compact output Add token-optimized output for docker compose commands: - `docker compose ps`: compact service listing with status and ports - `docker compose logs`: deduplicated log output via existing log engine - `docker compose build`: summary with build time, services, and step count - Unsupported compose subcommands pass through directly Includes 11 tests (8 compose format tests + 3 for existing compact_ports). Fixes thehoff#101 Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: address PR thehoff#110 review — use --format for compose ps, fix bytes/chars bugs - Switch format_compose_ps to parse structured --format tab output instead of fragile human-readable table (eliminates contains("Up") false positives and byte/char confusion) - Fix find('[') byte offset used with chars().skip() in build parsing - Use .next_back() instead of .last() on DoubleEndedIterator - Consistent error handling with .context()? in run_compose_ps - Strengthen test assertion for compose logs - Add tests for no-ports and long-image-path cases Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: propagate exit codes on compose failures + remove Vec allocation Address PR thehoff#110 review feedback from pszymkowiak: - Check output.status.success() after .output() in run_compose_ps, run_compose_logs, and run_compose_build to prevent silent failures when Docker daemon is not running - Replace .collect::<Vec<&str>>().len() with .count() in format_compose_build step counting to avoid unnecessary allocation Co-Authored-By: Claude Opus 4.6 <[email protected]> * docs: update version references to 0.20.1 after upstream rebase Sync documentation version strings with Cargo.toml after rebasing on upstream master. Fixes CI validate-docs check. Co-Authored-By: Claude Opus 4.6 <[email protected]> * chore: drop upstream workflow file from feature branch This workflow was pulled in during rebase on upstream master. Not part of the docker compose feature — let upstream manage it. Co-Authored-By: Claude Opus 4.6 <[email protected]> * chore: restore validate-docs workflow from upstream Workflow was unintentionally removed while resolving a push permission issue. Restored to match upstream master. Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Claude Opus 4.6 <[email protected]>
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.
Summary
Fixes the G1 (security core) findings from the full-codebase audit, issue #100. Codex-reviewed; the one review blocker (root-owned baseline) is fixed.
Findings fixed
integrity.rsruntime_check()—NoBaselinenow fails closed (bail!). A deleted.rtk-hook.sha256baseline used to let a tampered hook run undetected.integrity.rs— newcheck_baseline_trust(): rejects a baseline that is a symlink, group/world-writable, or owned by a foreign uid. Owner== euidor== rootis trusted (root = system-wide install pattern).utils.rs secure_git_command—--config-envadded to forbidden flags;alias./credential./filter.added to forbidden config-key prefixes (core.*exec keys were already covered — verified).utils.rs secure_cargo_command— stripsCARGO_ENCODED_RUSTFLAGS(higher-precedence sibling ofRUSTFLAGS).utils.rs secure_node_command— stripsNODE_PATH(module-shadowing vector).rewrite_cmd.rs— supply-chainVerdict::Unavailablenow downgrades auto-allow to Ask (exit 3), fail-closed, matchingBlock.integrity.rsrecovery text —rtk init/verify→contextcrawler.Out of scope (tracked separately under #100)
tirith_gate/supply_chain_gateinto thehook claudepath — a design decision, pending.Test plan
cargo test --workspace— 2293 pass, 0 fail (9 new tests: baseline symlink/world-writable/root-owned/foreign-uid, NoBaseline fail-closed,--config-env, alias/credential/filter git keys,NODE_PATH,CARGO_ENCODED_RUSTFLAGS, supply-chain Unavailable→Ask)cargo build --release+ clippy cleanPart of the #100 audit — that issue stays open for groups G2–G8.
🤖 Generated with Claude Code