Skip to content

feat(java): detect credential values passed into child-process environment maps (CWE-214) - #109

Open
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/credentials-env-var-sink
Open

feat(java): detect credential values passed into child-process environment maps (CWE-214)#109
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/credentials-env-var-sink

Conversation

@ai-anant

Copy link
Copy Markdown

New taint rule: a credential value obtained from a getter such as getPassword()/getSecret()/getPlainText()/getSecretValue()/getToken()/getApiKey() that flows into an environment map (EnvVars or another variable whose name matches 'env') passed to a launched child process.

Credentials placed into a child-process environment are inherited by all descendants, are visible to other processes running under the same OS user on the node (e.g. 'ps eww' on Linux), and appear in process dumps. The rule flags the generic shape so reviewers can route secrets through credential bindings, masked stdin, or permission-protected files instead.

Positive and negative testcases included under testcases/java/. Validated with semgrep 1.172 (pos fires, neg clean).

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