Skip to content

feat(java): detect non-literal value concatenated into a JS template-literal in served HTML (CWE-79) - #159

Open
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-jenkins-xss-js-template-literal-concat
Open

feat(java): detect non-literal value concatenated into a JS template-literal in served HTML (CWE-79)#159
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-jenkins-xss-js-template-literal-concat

Conversation

@ai-anant

Copy link
Copy Markdown

Detects the generic code shape where a non-literal value is concatenated into a JavaScript template-literal (...) string that is later embedded in a <script> block of generated HTML. If the value originates from user/config/SCM/request-controlled data, an embedded backtick or ${...} sequence breaks out of the template literal and executes arbitrary JavaScript (const txt = \" + userData + "``).

  • Rule: codevigilant.java.jenkins.xss.js-template-literal-concat (java, CWE-79)
  • Validated with semgrep; fires on the vulnerable concat shape, no finding on the application/json-in-script-block alternative.
  • New java/jenkins/xss/ tree.

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