Repository navigation
harden(system): env/ls/tree path-flag boundary + entropy-based secret masking (#100 G5) - #109
Merged
Merged
Conversation
… masking (#100 G5) Audit #100 group G5 (system commands). Codex-reviewed across 5 passes; the five review-iteration commits are squashed here into one so no token-shaped test literal remains in branch history. - env/ls/tree: a path beginning with `-` was parsed as a flag; a `--` argument boundary now separates options from path operands. - env: secret-shaped values are masked via a Shannon-entropy heuristic (`value_looks_sensitive`) in addition to the key-name substring check. - The path exclusion is structural-marker-only AND entropy-aware: a genuine path/URL is excluded only when it is not itself high-entropy, so a base64 secret (including one containing `/`, or one prefixed with `/`,`./`,`~/`) is still masked. Closes the base64/marker-prefix leaks found across Codex review passes 2-5. - pnpm `is_install_subcommand` covers the install-class aliases. - Secret-length floor tuned 24 -> 16; entropy + char-class gates absorb the false-positive risk. The Slack-token test fixture is assembled at runtime so the source carries no contiguous token-shaped literal (GitHub push-protection). cargo test --workspace: 2321 pass. Codex review x5: closed, mergeable. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced May 20, 2026
noogalabs
pushed a commit
to noogalabs/contextcrawler
that referenced
this pull request
Jun 4, 2026
* feat: add mypy command with grouped error output (80% token reduction) Add rtk mypy module that parses mypy type checker output, groups errors by file and error code, and produces compact summaries. Includes discovery registry pattern, hook rewrites, and 11 new tests (324 total). Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: address review - remove specs/ and clean CLAUDE.md Remove process docs (spec, plan, tasks, research, checklists) from specs/001-mypy-cmd/ and strip "Active Technologies" / "Recent Changes" sections from CLAUDE.md per PR thehoff#109 review feedback. Co-Authored-By: Claude Opus 4.6 <[email protected]> * fix: address review - deduplicate mypy handler, delegate from lint_cmd Make lint_cmd.rs delegate to mypy_cmd::filter_mypy_output() instead of maintaining a separate, less capable implementation. The mypy_cmd version handles column numbers, note continuations, file-less errors, and shows full error details. Removes 145 lines of duplicate code + 2 redundant tests. Co-Authored-By: Claude Opus 4.6 <[email protected]> --------- Co-authored-by: Robert Mohid <[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 G5 (system commands —
env,ls,tree) findings from audit #100. Codex-reviewed across 5 passes — final review: closed, mergeable. The five review-iteration commits are squashed into one (keeps the de-shaped Slack test fixture out of branch history so GitHub push-protection passes).Findings fixed
env/ls/treetreated a path beginning with-as a flag — a--argument boundary now separates options from path operands.envoutput leaked secret-shaped values. Newvalue_looks_sensitivemasks on a value-pattern + Shannon-entropy heuristic, alongside the existing key-name substring check./. Replaced with a structurallooks_like_path(a value is a path only with a real path/URL marker), and the exclusion is entropy-aware so a marker-prefixed high-entropy secret is still masked.is_install_subcommandcovers the install-class aliases.Heuristic contract (final)
A value is masked when it is high-entropy (Shannon ≥ 3.5 bits/char), ≥ 16 chars, ≥ 2 char classes, and not whitespace/dotted-filename shaped. A genuine filesystem path or URL is excluded only when it is not itself high-entropy — real paths are low-entropy and stay unmasked, while a secret that merely starts with
/or./is still caught.Review history
5 Codex passes: base review found the secret leak; pass 2 caught the bare-
/exclusion leaking base64 secrets; pass 3 narrowed it to a structural path heuristic; pass 4 caught a two-slash base64 blob mis-splitting as a 3-segment path; pass 5 made the path exclusion entropy-first so a marker-prefixed secret can't evade. Final verdict: closed, mergeable.Test plan
cargo test --workspace— 2321 pass, 0 fail;node_hardening/system_hardeninggreen/, two/, marker-prefixed) all masked;PATH/./rel/https:///C:\all unmaskedcargo build --releasecleanPart of the #100 audit.
🤖 Generated with Claude Code