Skip to content

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

Closed

Description

@ajianaz

Found in the post-0.16.1 code review. is_false_positive_secret's is_bare_identifier check is a tautology, so any line whose first unquoted ':' is followed by an unquoted alphabetic token is dropped. const password: string = "..." (TS), password: str = "..." (Python) and let password: &str = "..." (Rust) are not flagged on v0.16.1 / develop (reproduced with cora scan, LLM unreachable).

Activity

  1. ajianaz commented on Oct 9, 2026

    @ajianaz
    CollaboratorAuthor

    Correction after investigation: the always-true is_bare_identifier check is a real bug but not the cause of these misses. The security scanner, the built-in rule and the LLM cross-check (apply_llm_secret_fp_filter) all required the literal right after password = / password:, so a type annotation (password: string = "...") matched none of them, and the cross-check also dropped the LLM's finding (and findings on single-quoted literals). Fixed in the linked PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions