Skip to content

feat(java): detect HTTP client base URL set from a config-driven/non-literal expression via ApiClient.setBasePath (CWE-918) - #141

Open
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-jenkins-api-client-setbasepath-nonliteral-url
Open

feat(java): detect HTTP client base URL set from a config-driven/non-literal expression via ApiClient.setBasePath (CWE-918)#141
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-jenkins-api-client-setbasepath-nonliteral-url

Conversation

@ai-anant

Copy link
Copy Markdown

Adds a Java/Jenkins rule detecting HTTP-client base URLs assigned from a non-literal expression via ApiClient.setBasePath() instead of a fixed string literal.

When the base URL originates from a plug-in configuration field (global/folder/job setting) and no scheme/host allowlist is enforced, an authenticated user who can edit that configuration can redirect the outbound client at an internal service (loopback, router, cloud metadata 169.254.169.254) or a host they control. Requests built on that base URL routinely carry credentials, so it can also exfiltrate stored API keys/tokens/stored credentials.

Rule: codevigilant.java.jenkins.ssrf.api-client-setbasepath-nonliteral

  • severity HIGH, CWE-918, technology jenkins, confidence MEDIUM
  • pattern-not excludes string-literal base URLs
  • validated with semgrep --validate; fires on a non-literal repro, stays silent on a literal base-URL negative repro.

…-driven expression via ApiClient.setBasePath (CWE-918)
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