Repository navigation
fix(ui): bump jQuery and Bootstrap, fix modal XSS - #177
Merged
Merged
Conversation
jQuery 3.1.0 is affected by CVE-2019-11358 (prototype pollution in jQuery.extend, fixed in 3.4.0) and CVE-2020-11022/CVE-2020-11023 (XSS via htmlPrefilter, fixed in 3.5.0). 3.7.1 is the latest 3.x release and has no known advisories. jQuery 4 is not an option because Bootstrap 3 refuses to run on it. The files are the unmodified dist/ of the [email protected] npm package and match the SRI hashes published on releases.jquery.com. Signed-off-by: Sachin Kamboj <[email protected]>
Bootstrap 3.3.7 is affected by CVE-2016-10735, CVE-2018-14040, CVE-2018-14042, CVE-2018-20676, CVE-2018-20677 and CVE-2019-8331, all fixed by 3.4.1. 3.4.1 is the final 3.x release; it still carries CVE-2024-6485 (button data-loading-text) and CVE-2025-1647 (popover and tooltip), neither of which the UI uses. The files are the unmodified dist/ of the [email protected] npm package and match the SRI hashes published on getbootstrap.com. Signed-off-by: Sachin Kamboj <[email protected]>
check_all embeds every peer's /check response verbatim, and the UI wrote that data into the page with .html(): node ids, which come from peer-reported podResults keys, went into the modal title, and prepareJSON() concatenated JSON.stringify() output, which does not escape < or >, into an HTML string for the modal body. Any pod that matches the goldpinger label selector could therefore run script in the browser of whoever opens the dashboard - the same lying-peer threat model that bloomberg#174 addressed for /cluster_health. prepareJSON() now returns a <code> element filled via .text(), which callers attach with .empty().append(), and modal titles are set with .text(). Legitimate data renders exactly as before. Signed-off-by: Sachin Kamboj <[email protected]>
Signed-off-by: Sachin Kamboj <[email protected]>
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The dashboard bundles two front-end libraries from 2016, jQuery 3.1.0 and Bootstrap 3.3.7, and both have published CVEs (counts from OSV.dev):
The image scan in #175 / #176 didn't catch these, because Trivy only finds JavaScript libraries through package manifests, and these files are copied in directly.
#171 and #172 tried to fix two of these CVEs by applying upstream commits by hand, but neither works:
jquery.jsandbootstrap.js, whilestatic/index.htmlloads the.min.jsbuilds. The browser would run exactly the same code after merging.s.contents.script = falseprefilter, gh-2432).Upgrading the vendored libraries fixes all of these properly and replaces both PRs.
While checking the UI against the same threat model as #174 (a pod that matches the label selector and lies in its
/checkresponse), I also found an XSS that no library version fixes:/check_allembeds every peer's response verbatim..html().podResultskeys, went into the modal title.prepareJSON()built the modal body as an HTML string aroundJSON.stringify()output, which doesn't escape<or>.So any such pod could run script in the browser of whoever opens the dashboard. #174 stopped a lying peer from crashing
/cluster_health; this stops it from attacking dashboard viewers.After this PR, the UI has no reachable known CVEs from its libraries, and peer-supplied strings render as text.
Summary
fix(ui): upgrade vendored jQuery to 3.7.1fix(ui): upgrade vendored Bootstrap to 3.4.1data-loading-text(CVE-2024-6485) and in Popover/Tooltip (CVE-2025-1647). The UI uses neither.dist/of the npm packages, in the same layout as before (unminified, minified, slim and source maps for jQuery; css, fonts and js for Bootstrap).static/index.htmlpoints at the new paths.fix(ui): escape peer data rendered in modalsprepareJSON()now returns a<code>element filled with.text(), and callers attach it with.empty().append().#modal-titlewrite uses.text()..html()call is the heatmap<img>, whose URL is built only fromNumber()values andDate.now().chore(version): bump tov3.11.5/ chart1.1.5(v3.11.4 is already tagged).Supersedes #171 and #172.
Test plan
js/min/slim/slim.min; Bootstrapbootstrap.min.css/bootstrap-theme.min.css/bootstrap.min.js) match the official values.app.kubernetes.io/name=goldpingerwhose/checkputs markup inpodResultskeys and in anerrorvalue.errorfield in the Data modal.JSON.stringify(data, undefined, 4), and real pod modals keep theirwhite-space: preformatting.