Skip to content

fix(rules): secret rules ignore name: value entries with non-literal values (#661) - #664

Merged
ajianaz merged 2 commits into
developfrom
fix/661-secret-colon-values
Oct 15, 2026
Merged

ajianaz merged 2 commits into
developfrom
fix/661-secret-colon-values

Conversation

@ajianaz

@ajianaz ajianaz commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #661.

What

In source files (rhs_style == Code), a name: value entry whose value is not a quoted literal is no longer reported by crypto/hardcoded-secret / sec-hardcoded-secret: webhook_secret: env::var("X"), refresh_token: prev?.refresh_token, token: Option<&'static str>, "password": ACCOUNT_PW, "clientSecret": j["clientSecret"]. Format placeholders ("{}", "{key}", "%s") are references, not values. Quoted literals (token: "ghp_..."), = assignments and config-style files (YAML, TOML, ...) are judged exactly as before.

Why

Issue #661: on two real codebases (uteke, uteke-cloud) all 38 Critical/Major findings were false positives, 26 from these rules; every Critical blocks --ci / hook.mode: block.

Testing

ajianaz and others added 2 commits October 15, 2026 14:43
…values (#661)

In source files a bare expression after name: (env reads, member access,
type annotations, dict values) is a reference or a type, never a secret,
and format placeholders are not values. Quoted literals are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
Every name: value entry on a line must be a non-literal (a harmless first
entry no longer hides a later real secret), an env read with a literal
fallback stays flagged, and braced values containing digits are not
format placeholders.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: ajianaz <ajianaz@users.noreply.github.com>
@ajianaz
ajianaz merged commit 64176b9 into develop Oct 15, 2026
14 checks passed
@ajianaz
ajianaz deleted the fix/661-secret-colon-values branch October 15, 2026 08:01
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): crypto/hardcoded-secret flags env reads, type names and fixtures (38/38 Critical/Major were false positives)

1 participant