Security context
High· 8.0GHSA-xpvp-h73c-m9rq CVE-2022-41224CWE-79Published Sep 22, 2022

Jenkins vulnerable to stored cross site scripting in the I:helpIcon component

Research this vulnerability

Research is free — Hunters explains how the bug works, the root-cause code pattern, how the fix addresses it, and how to test whether a target is affected, in chat. Investigate & write exploit is a paid run — the engine reads the advisory and fix commits, then builds and validates a working proof-of-concept exploit with reproduction steps.

Affected versions

2.367 → fixed in 2.370

Details

Jenkins 2.367 through 2.369 (both inclusive) does not escape tooltips of the `l:helpIcon` UI component used for some help icons on the Jenkins web UI, resulting in a stored cross-site scripting (XSS) vulnerability exploitable by attackers able to control tooltips for this component. As of publication, the Jenkins security team is unaware of any exploitable help icon/tooltip in Jenkins core or plugins published by the Jenkins project. The vast majority of help icons use the `l:help` component instead of l:helpIcon. The few known instances of `l:helpIcon` do not have user-controllable tooltip contents.

The fix

[SECURITY-2886]

Daniel Beck· Sep 21, 2022, 06:33 AM+1184f41d2921
core/src/main/resources/lib/layout/helpIcon.jelly+1 1
@@ -19,7 +19,7 @@
<j:if test="${attrs.iconSize != null}">
<j:set var="iconSize" value="icon-${iconSize}"/>
</j:if>
- <l:icon tooltip="${tooltip}"
+ <l:icon tooltip="${h.htmlAttributeEscape(tooltip)}"
class="${class} ${iconSize}"
src="symbol-help-circle" />
</j:jelly>

References