Skip to content

feat(java): detect HttpResponses.html served with non-literal content (CWE-79) - #125

Open
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-jenkins-httpresponses-xss-tainted
Open

feat(java): detect HttpResponses.html served with non-literal content (CWE-79)#125
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-jenkins-httpresponses-xss-tainted

Conversation

@ai-anant

Copy link
Copy Markdown

New rule: codevigilant.java.jenkins.xss.httpresponses-html-tainted.

Detects org.kohsuke.stapler.HttpResponses.html() called with a non-literal argument. The method serves the value as text/html in the Jenkins origin; when the value derives from a remote server response (report/API HTML), job configuration or build data, embedded markup executes with the viewer's Jenkins session.

  • Tree: java/jenkins/xss/
  • Severity HIGH, confidence MEDIUM, CWE-79, validated with semgrep --validate (semgrep 1.172.0)
  • Positive repro (fires): HttpResponses.html(getReportContent()) / HttpResponses.html(content)
  • Negative repro (no fire): HttpResponses.html("static")

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