Repository navigation
Conversation
Fix all high-severity CodeQL findings in the docbook branding stylesheet: - js/insecure-download: three $.getScript() calls fetched executable JavaScript from cdnjs.cloudflare.com over plain HTTP (man-in-the-middle tampering). Switch them to HTTPS; cdnjs serves the same paths over TLS. - js/xss-through-dom: wrapConfigurablesFn read element text with .text() and re-inserted it with .html(), reinterpreting any &, < or > in the text as markup. Escape those metacharacters first via a small escapeHtml() helper before wrapping the example strings. - js/incomplete-hostname-regexp: the example host was used directly as a RegExp, so its dots matched any character. Build the pattern through an escapeRegExp() helper so the literal string is matched literally. Verified with Node: the file parses, HTML metacharacters are escaped, the example strings are still wrapped in their styled spans, and the escaped host pattern no longer matches unrelated hosts.
maximthomas
approved these changes
Jul 21, 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.
Summary
Fixes all high-severity CodeQL alerts in the docbook branding stylesheet
commons/doc-default-branding/.../docbkx-stylesheets/bootstrap/scripts.js(a generated-documentation asset). Six alerts across three rules, all in this one file.Changes
js/insecure-download(#2031, #2032, #2033) — three$.getScript()calls fetched executable JavaScript fromcdnjs.cloudflare.comover plain HTTP, which is open to man-in-the-middle tampering. Switched to HTTPS; cdnjs serves the same paths over TLS.js/xss-through-dom(#2034, #2035, #2036) —wrapConfigurablesFnread an element's text with.text()and re-inserted it with.html(), so any&,<or>in the text was reinterpreted as markup. The text is now passed through a smallescapeHtml()helper before the example strings are wrapped.js/incomplete-hostname-regexp(#2039) — the example host was used directly as aRegExp, so its dots matched any character. The pattern is now built through anescapeRegExp()helper so the literal string is matched literally.Verification
Node smoke test on the patched file:
<b>,<script>,&) in the source text are escaped;openamXexampleYcom).