Skip to content

fix(rules): flag hardcoded secrets in typed declarations; accept single-quoted literals in the LLM cross-check - #608

Merged
ajianaz merged 1 commit into
developfrom
fix/secret-typed-declaration
Oct 9, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/secret-typed-declaration

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

What

  • Security scanner pattern, built-in sec-hardcoded-secret rule and the LLM secret cross-check (apply_llm_secret_fp_filter) allow an optional type annotation between the name and =.
  • The cross-check also accepts single-quoted literals.
  • The object-shorthand filter's always-true is_bare_identifier check now rejects values containing a string literal.

Why

const password: string = "..." (TS), password: str = "..." (Python) and let password: &str = "..." (Rust) were not flagged, and cora review dropped 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 scan now flags line 1 of the TS, Python and Rust samples; cora review with the real LLM reports a single-quoted typed secret.

Closes #607

🤖 Generated with Claude Code

…le-quoted literals in the LLM cross-check (#607)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@ajianaz
ajianaz merged commit 5ac4df9 into develop Oct 9, 2026
14 checks passed
@ajianaz
ajianaz deleted the fix/secret-typed-declaration branch October 16, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(rules): hardcoded-secret filter misses typed declarations (const password: string = "...")

1 participant