Repository navigation
fix(rules): stop flagging env reads, call expressions and interpolation as hardcoded secrets (#616, #617) - #627
Merged
Conversation
This was referenced Oct 9, 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
Classify the right-hand side of secret-named assignments before reporting a hardcoded secret. The file path is now passed to the hardcoded-secret filter (
post_match_filter_for_path; the path-lesspost_match_filteris test-only), and the LLM cross-check (has_secret_literal) uses the same classifier.Rules (
non_literal_rhsinsrc/engine/rules/builtin.rs):b"...",r#"..."#,String::from(".."),"a" + "b"), unless the whole value is a pure reference:"${X}","$X","$(cmd)".$or containing${..},$(..)or a backtick is interpolation/command substitution: not a secret, in any file.Why
Env reads, calls and
${VAR}interpolation were reported as hardcoded secrets. Closes the FP groups pinned inKNOWN_GAPSby #615.Testing
KNOWN_GAPSintoCASES(expected=false), plus new rows on both sides (real secrets in .env/.properties/shell/toml/ini/compose, concatenated and prefixed literals, mixed"${P}literal").KNOWN_GAPSnow only holds new FN shapes:os.environ.get("X", "literal"),process.env.X || "literal",unwrap_or("literal".into()),${X:-literal},new String("literal").bare_identifier_rhs_in_code_is_not_a_hardcoded_passwordreplaces the old Rustlet password = supersecret123;positive.-D warnings, fullcargo testx3 green. Verified with the built binary (cora scan/cora review --staged) on positive and negative samples per shape.Closes #616
Closes #617
🤖 Generated with Claude Code