Problem/Motivation

Webpack has released a security advisory: https://github.com/webpack/webpack/security/advisories/GHSA-4vvj-4cpr-p986

It does not appear that Drupal core is affected; we only use Webpack to build CKEditor 5 and the output is no different on the old and new versions. However, we should upgrade anyway to avoid security scanners from complaining.

Steps to reproduce

Proposed resolution

Update Webpack to 5.94.0 or greater on all supported branches, down to 10.2.x if possible.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Webpack has been updated to version 5.95.0 to incorporate a security release which did not affect Drupal core. This update introduces a change to the supported browser list, which allows more modern CSS to be produced, notably the :dir pseudo class. Drupal core has required all browser versions to support :dir since December 2023, so this is applying what was already existing policy.

Issue fork drupal-3477805

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

longwave credited spokje.

longwave’s picture

spokje’s picture

Assigned: Unassigned » spokje

spokje’s picture

10.2.x MR !9701
10.3.x MR !9700
10.4.x MR !9699
11.0.x: MR !9698
11.x: MR !9697

The 11's-MRs were created using node v20.17.0, the 10's MRs were created using node v18.20.4

spokje’s picture

Status: Active » Needs review

I've ran a yarn build in all MRs

10.4.x and 10.3.x introduced a lot of CSS changes, not too sure where those came from.
10.2.x introduces jquery-ui map file changes on top of the above CSS changes. The same amount of confidence where those came from, namely none.

Either the webpack update introduces some CSS/JS linting changes, which I find unlikely, or the changes for these were already made before these MRs and somehow yarn build was never ran.

I'll leave that to the experts.

spokje’s picture

Title: Update Webpack to 5.94.0 » Update Webpack to 5.95.0
longwave’s picture

Status: Needs review » Reviewed & tested by the community

Did some digging to find out what happened here.

As far as I can tell, the CSS changes are due to the bump in caniuse-lite which determines what the browserslist key means in package.json. The bulk of the changes are swapping from prefixing with the [dir=rtl] attribute at the top of the DOM to using the :dir() pseudo-class. The pseudo-class is available since December 2023 according to caniuse so it makes sense that upgrading caniuse-lite results in the use of newer features when rebuilding the CSS.

In 10.2.x the change is adding "ignoreList":[] to the generated source maps for jQuery UI. This also appears to be a relatively recent feature, I couldn't find where it was added exactly but the map files are generated by Terser which was also upgraded here, so it makes some sense for this to change. This change looks harmless anyway as the ignoreList is always empty.

Therefore I think all these changes are valid and OK to commit.

quietone’s picture

Issue tags: +Needs release note
spokje’s picture

Issue summary: View changes
Issue tags: -Needs release note

Thanks @longwave for the sleuthing, sense = made.

Thanks @quietone, added release note snippet

spokje’s picture

Assigned: spokje » Unassigned

  • catch committed 72046fb4 on 10.4.x
    Issue #3477805 by spokje, longwave: Update Webpack to 5.95.0
    
catch’s picture

I double checked the caniuse data because I was concerned Firefox ESR when 10.3.0 might possibly have not supported this, but actually firefox was one of the first to support it and it's chrome and edge that didn't add full support until December 2023. This to me means we're clear back to 10.3.x

For 10.2.x, at the time that 10.2.x was released, we probably did support browser versions that didn't support the dir pseudoclass, so going to get a second opinion for that.

  • catch committed 4891ca93 on 10.3.x
    Issue #3477805 by spokje, longwave: Update Webpack to 5.95.0
    

  • catch committed 04da543d on 11.0.x
    Issue #3477805 by spokje, longwave: Update Webpack to 5.95.0
    

  • catch committed 6e8300b1 on 11.x
    Issue #3477805 by spokje, longwave: Update Webpack to 5.95.0
    
catch’s picture

Version: 11.x-dev » 10.2.x-dev

Committed/pushed to 11.x, 11.0.x, 10.4.x and 10.3.x, leaving RTBC against 10.2.x

catch’s picture

Issue summary: View changes

Added a more detailed release not directly in the 10.3.6 release notes draft and also the issue summary https://docs.google.com/document/d/1xqpX5FHvfpFjN3Xg47ESFSFu5WUjCEP4sjiO...

longwave’s picture

Version: 10.2.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Given that Drupal is not affected by this security release and there is a risk of breaking CSS if users are still relying on the browsers initially supported by 10.2, I think this is not worth fixing there now. Users who are bothered by security scanners complaining about an insecure Webpack should upgrade to Drupal 10.3.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.