Miggo Logo

CVE-2021-21649: Cross-site Scripting in Jenkins Dashboard View Plugin

5.4

CVSS Score
3.1

Basic Information

EPSS Score
0.75793%
Published
6/16/2021
Updated
12/27/2023
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.jenkins-ci.plugins:dashboard-viewmaven>= 2.13, < 2.162.16
org.jenkins-ci.plugins:dashboard-viewmaven< 2.12.12.12.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stemmed from unsanitized URL handling in Image Dashboard Portlets. The commit diff shows:

  1. The 'url' property was renamed to 'imageUrl' to enforce validation
  2. A new getUrlError() validation method was added to restrict URLs to http/https/relative
  3. The Jelly template (portlet.jelly) was modified to conditionally render based on URL validity
  4. The deprecated getUrl() method in ImagePortlet.java directly returned user input without validation
  5. Test cases demonstrate XSS prevention by validating against URLs like '<img/src/onerror=alert(...)' The pre-patch code path through getUrl() allowed arbitrary URL injection, while post-patch validation in getImageUrl() and isUrlValid() mitigates this.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

J*nkins **s**o*r* Vi*w Plu*in prior to *.** *n* *.**.* *o*s not *s**p* URLs r***r*n*** in Im*** **s**o*r* Portl*ts, r*sultin* in * stor** *ross-sit* s*riptin* (XSS) vuln*r**ility *xploit**l* *y *tt**k*rs wit* Vi*w/*on*i*ur* p*rmission. *s p*rt o* t*

Reasoning

T** vuln*r**ility st*mm** *rom uns*nitiz** URL **n*lin* in Im*** **s**o*r* Portl*ts. T** *ommit *i** s*ows: *. T** 'url' prop*rty w*s r*n*m** to 'im***Url' to *n*or** v*li**tion *. * n*w **tUrl*rror() v*li**tion m*t*o* w*s ***** to r*stri*t URLs to *