Skip to content

Update the Gaurav theme's jQuery and Bootstrap, and drop jQuery from Basic Mobile - #350

Open
mraible wants to merge 4 commits into
roller-6.1.xfrom
gaurav-basicmobile-jquery-6.1.x
Open

mraible wants to merge 4 commits into
roller-6.1.xfrom
gaurav-basicmobile-jquery-6.1.x

Conversation

@mraible

@mraible mraible commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

This backports master's theme fixes to 6.1.x, with jQuery 3.8.0 in the Gaurav theme.

  • Gaurav: the theme shipped jQuery 1.12.4 and Bootstrap 3.4.0, which have known XSS vulnerabilities (CVE-2015-9251, CVE-2019-11358, CVE-2020-11022, CVE-2020-11023 and CVE-2019-8331). It now ships jQuery 3.8.0 and Bootstrap 3.4.1, the last Bootstrap 3 release. jQuery 3.8.0 is the unmodified dist/jquery.min.js from the npm package, checked against the registry's integrity hash. File names don't change, so the templates and theme.xml stay the same. (cherry-picked from eaca41f)
  • Basic Mobile: the theme loaded jQuery 2.1.1 and jQuery Mobile 1.4.2 from code.jquery.com over plain http. Its templates now use plain CSS in basic-mobile-custom.css and a few lines of plain JavaScript for the view switch. (cherry-picked from 021872f)
  • Basic Mobile follow-up: the mobile templates request their stylesheet with ?deviceType=mobile, and the day template's teaser test is fixed. Master's roller.js change in that commit isn't needed here, because 6.1.x's roller.js has no jQuery block. (cherry-picked from 7092e91)
  • roller-ui/scripts/jquery-2.1.1.min.js is removed. Nothing references it.
  • The binary LICENSE names jQuery 3.8.0 in place of the removed file and a jQuery UI 1.11.0 directory that is no longer in the tree.

On a local 6.1.x build, the Gaurav theme's jquery.js and bootstrap.js load without errors, and the navbar collapse and dropdown open. Weblogs that customized either theme keep their own copies of these files.

The gaurav theme bundled jQuery 1.12.4, which has known XSS vulnerabilities (CVE-2015-9251, CVE-2019-11358, CVE-2020-11022, CVE-2020-11023), and Bootstrap 3.4.0, which has CVE-2019-8331. It now ships jQuery 3.7.1 and Bootstrap 3.4.1, the last Bootstrap 3 release, taken unmodified from the official webjars. The old files were unmodified 3.4.0 releases, so no local changes are lost, and the file names stay the same so the theme's templates and theme.xml don't change. The theme uses only Bootstrap's collapse and dropdown plugins, both verified at phone and desktop widths.

roller-ui/scripts/jquery-2.1.1.min.js is removed. Nothing in Roller references it, and serving it exposed another vulnerable jQuery.

Weblogs that customized the gaurav theme keep their own copies of these files.

(cherry picked from commit eaca41f)
The theme loaded jQuery 2.1.1 and jQuery Mobile 1.4.2 from code.jquery.com over plain http. Both versions have known XSS vulnerabilities, jQuery Mobile is no longer maintained, and the standard weblog template's own Content-Security-Policy (script-src 'self') already blocked the script, which left its View Mobile Weblog link doing nothing.

The mobile templates keep their data-role markup, which the Velocity mobile macros also emit, and basic-mobile-custom.css now styles it directly: header and footer bars, inset list views with dividers, the next/previous navbar, and buttons. The category chooser opens with CSS :target from its existing #categories link. The view switch links carry ?deviceType=standard or ?deviceType=mobile, which MobileDeviceRepository already honors, and a few lines of plain JavaScript remember the choice in the roller_user_request_type cookie as before. permalink-mobile.vm's comment list also gets its missing closing </ul>.

roller-ui/styles/jquery.mobile-theme stays, because weblogs that customized this theme have their own copies of the templates that still reference it.

(cherry picked from commit 021872f)
The mobile templates now request their stylesheet with ?deviceType=mobile. The server picks a stylesheet rendition from the device cookie or user agent, so a mobile page reached through a ?deviceType=mobile link got the standard stylesheet; jQuery Mobile's own CSS used to hide that.

The mobile day template chose between an entry's text and its summary by testing whether the text was empty, so entries without a summary printed a literal $entry.transformedSummary or an empty teaser. It now tests the summary and uses quiet references.

roller.js is included with every weblog's comment form, but most themes don't load jQuery, so its form validation block threw "$ is not defined" on those pages. The block now runs only when jQuery Validation is present, which the admin and editor pages still load.

(cherry picked from commit 7092e91)
jQuery 3.8.0, released on 2026-11-17, fixes a ReDoS in selector identifier matching. The theme's jquery.js is the unmodified dist/jquery.min.js from the npm package, checked against the registry's integrity hash.

The binary LICENSE names it in place of the removed jquery-2.1.1.min.js and a jQuery UI 1.11.0 directory that is no longer in the tree.
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