Skip to content

feat(bash): detect hardcoded credential/token literals (CWE-798) - #145

Open
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/bash-hardcoded-credential-literal
Open

feat(bash): detect hardcoded credential/token literals (CWE-798)#145
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/bash-hardcoded-credential-literal

Conversation

@ai-anant

Copy link
Copy Markdown

Adds a bash/shell rule that flags variable assignments of a credential-named variable (TOKEN / SECRET / PASSWORD / API key / AUTH / credential) to a long hardcoded literal value.

Generic pattern only — no specific project is referenced. Hardcoded credentials committed to source are exposed to all repository readers and can leak into build logs, container images and CI artifacts (CWE-798, CWE-256). The rule ships with metavariable-regex name/value filters and indirection/placeholder pattern-not exclusions to keep false positives low.

Validated: semgrep --validate --config bash/; fires on positive repro, silent on sanitized negative.

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.

1 participant