Repository navigation
fix(rules): flag hardcoded secrets in typed declarations; accept single-quoted literals in the LLM cross-check - #608
Merged
Conversation
…le-quoted literals in the LLM cross-check (#607) Co-Authored-By: Claude Sonnet 5.5 <[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.
What
sec-hardcoded-secretrule and the LLM secret cross-check (apply_llm_secret_fp_filter) allow an optional type annotation between the name and=.is_bare_identifiercheck now rejects values containing a string literal.Why
const password: string = "..."(TS),password: str = "..."(Python) andlet password: &str = "..."(Rust) were not flagged, andcora reviewdropped the LLM's finding on them and on single-quoted literals as a false positive (#607).Testing
New unit tests for the scanner (typed literal flagged, typed non-literal not flagged), the LLM cross-check (typed and single-quoted kept) and the shorthand filter. fmt, clippy -D warnings, full suite 3x green (1114). Local binary:
cora scannow flags line 1 of the TS, Python and Rust samples;cora reviewwith the real LLM reports a single-quoted typed secret.Closes #607
🤖 Generated with Claude Code