fix(review): add post-LLM filter for hardcoded secret false positives#325
Merged
Conversation
Cora LLM sometimes flags struct field declarations (e.g. api_key: String) as 'Hardcoded password or secret in variable' even when no literal value is present. The built-in sec-hardcoded-secret regex only matches actual assignments like api_key = "sk-...", but the LLM can hallucinate these findings regardless of .cora.yaml rules. Add apply_llm_secret_fp_filter that cross-validates LLM security findings against actual diff lines. If a finding about hardcoded secrets points to a line that doesn't match the sec-hardcoded-secret regex, it's removed as a false positive. Unknown/unresolvable lines are kept (safe default). 4 unit tests cover: FP removal, real secret retention, non-security pass-through, and unknown-line preservation.
- git2 0.21.0 fixes RUSTSEC-2026-0183 (null ptr in Remote::list) and RUSTSEC-2026-0184 (null ptr in Blame::blame_buffer Signature) - Remote::url() API changed from Option<&str> to Result<&str, Error> - Adapted get_repo_info() to use .url().ok() chain
Resolves remote memory exhaustion DoS vulnerability in quinn-proto unbounded out-of-order stream reassembly.
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.
Problem
Cora LLM sometimes flags struct field declarations like
api_key: Stringorapi_key: extract_api_key.clone()as "Hardcoded password or secret in variable" — even though no literal value is present.The
.cora.yamlrulesfield is only LLM context (non-deterministic), so instructions to ignore these are unreliable.Solution
1. Post-LLM false positive filter
Add
apply_llm_secret_fp_filter— a deterministic post-LLM filter that:issue_type: securityand titles matching hardcoded secret keywordsfile:linein the parsed diffsec-hardcoded-secretregex (key = "literal")Pipeline position:
2. Dependency security fixes
git20.20 → 0.21 (resolves RUSTSEC-2026-0183, RUSTSEC-2026-0184)quinn-proto0.11.14 → 0.11.15 (resolves RUSTSEC-2026-0185)Testing
4 unit tests for the FP filter:
All 596 tests pass. Clippy clean. Fmt clean.