Skip to content

feat(java): detect Jelly anchors with tainted href expressions (CWE-79) - #119

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

feat(java): detect Jelly anchors with tainted href expressions (CWE-79)#119
ai-anant wants to merge 1 commit into
CodeVigilant:mainfrom
ai-anant:rule/java-jenkins-jelly-href-xss

Conversation

@ai-anant

Copy link
Copy Markdown

Adds a Jenkins/Jelly rule:

codevigilant.java.jenkins.xss.jelly-href-tainted — fires on <a href="${...}">
in Jelly views when the href is bound to an expression whose scheme is not pinned
to http/https or the Jenkins rootURL variable. Server/network/config-derived URL
values (e.g. an SCM server-supplied base URL concatenated into the href) can carry
a javascript: or data: scheme, yielding stored XSS in the Jenkins UI when the
rendered link is clicked.

Scan note: Jelly files are XML; run with the rule language selected (e.g.
semgrep --config <rules> --lang xml <path>/*.jelly) since .jelly is not in
semgrep's default XML extension list.

Validated with semgrep --validate; tested against a positive repro (two tainted
anchors - fires) and a negative repro (rootURL/static https anchors - no findings).

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