Skip to content

feat(java): detect credential constructors hardcoding CredentialsScope.GLOBAL (CWE-269) - #146

Open
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-jenkins-credential-global-scope
Open

feat(java): detect credential constructors hardcoding CredentialsScope.GLOBAL (CWE-269)#146
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-jenkins-credential-global-scope

Conversation

@ai-anant

Copy link
Copy Markdown

Adds a java rule for the Jenkins ecosystem that flags construction of a credentials object (UsernamePasswordCredentialsImpl, BasicSSHUserPrivateKey, StringCredentialsImpl, OAuth2Credentials, DockerServerCredentials, etc.) whose scope is hardcoded to CredentialsScope.GLOBAL.

Generic pattern only; no specific project referenced. Forcing GLOBAL scope on construction can over-broaden exposure of otherwise scope-limited secrets (CWE-269 / CWE-200). Pattern-not / regexes included to keep scope; confidence MEDIUM to account for deliberate global-scope usage.

Validated: semgrep --validate --config java/; 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