Problem/Motivation

yarn audit gives:

[ayrton:core | Sat 12:44:37] $ yarn audit
yarn audit v1.22.4
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ netmask npm package vulnerable to octal input data           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ netmask                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=2.0.1                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ nightwatch                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ nightwatch > proxy-agent > pac-proxy-agent > pac-resolver >  │
│               │ netmask                                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1658                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ ini                                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >1.3.6                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint > global-modules > global-prefix > ini             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1589                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ ini                                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >1.3.6                                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > global-modules >    │
│               │ global-prefix > ini                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1589                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ y18n                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=5.0.5||>=4.0.1 <5.0.0||>=3.2.2 <4.0.0                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ nightwatch                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ nightwatch > mocha > yargs > y18n                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1654                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ y18n                                                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=5.0.5||>=4.0.1 <5.0.0||>=3.2.2 <4.0.0                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ nightwatch                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ nightwatch > mocha > yargs-unparser > yargs > y18n           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1654                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
6 vulnerabilities found - Packages audited: 1106
Severity: 3 Low | 3 High

Proposed resolution

Update them, including increasing our constraint for Nightwatch.

Release notes snippet

Drupal core's development dependency on the Nightwatch npm package has been increased from 1.2.1 to 1.6.3 and all locked versions of dependencies have been updated to address security issues in these dependencies.

The minimum version of node.js for 8.9.x development has been increased to version 10.

CommentFileSizeAuthor
#25 3211810-25-9.0.x.patch281.61 KBSpokje
#25 reroll_diff_14_25-9.0.txt2.94 KBSpokje
#25 reroll_diff_14_25-8.9.x.txt2.7 KBSpokje
#25 3211810-25-8.9.x.patch140.43 KBSpokje
#25 reroll_diff_14_25-9.1-x-9.2.x-9.3.x.txt2.15 KBSpokje
#25 3211810-25-9.1-x-9.2.x-9.3.x.patch279.17 KBSpokje
#19 3211810-18-8.9.x.patch141.22 KBalexpott
#19 14-18-interdiff.txt287 bytesalexpott
#15 3211810-14-9.1-x-9.2.x-9.3.x.patch279.36 KBalexpott
#15 2-14-9.1.x-9.2.x-9.3.x-interdiff.txt2.3 KBalexpott
#15 3211810-14-9.0.x.patch282.06 KBalexpott
#15 2-14-9.0.x-interdiff.txt16.28 KBalexpott
#15 3211810-14-8.9.x.patch141.03 KBalexpott
#15 2-14-8.9.x-interdiff.txt13.86 KBalexpott
#11 diff-yarnlock-after-upgrading-postcss-custom-properties-to-10.txt4.15 KBAmber Himes Matz
#2 yarn-3211810-2-8_9_x.patch126.86 KBxjm
#2 yarn-3211810-2-9_0_x.patch266.21 KBxjm
#2 yarn-3211810-2-9_1_x.patch271 KBxjm
#2 yarn-3211810-2-9_2_x.patch271 KBxjm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xjm created an issue. See original summary.

xjm’s picture

Kristen Pol’s picture

Thanks for the issue and patches.

  1. Confirmed that all patches update nightwatch from ^1.2.1 to ^1.6.3
  2. All patches applied cleanly to their respective branches and modified core/package.json and core/yarn.lock files
  3. Ran composer update after patching and these additional files were modified:
            modified:   composer.lock
    	modified:   composer/Metapackage/CoreRecommended/composer.json
    	modified:   composer/Metapackage/PinnedDevDependencies/composer.json
    
Kristen Pol’s picture

After patching, here's what I see for yarn audit:

9.2

KristenBackupMBP:core admin$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
1 vulnerabilities found - Packages audited: 1139
Severity: 1 Low
✨  Done in 1.40s.

9.1

KristenBackupMBP:core admin$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
1 vulnerabilities found - Packages audited: 1139
Severity: 1 Low
✨  Done in 1.64s.

9.0

KristenBackupMBP:core admin$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ is-url-superb > url-regex                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
3 vulnerabilities found - Packages audited: 1050
Severity: 1 Low | 2 High
✨  Done in 1.55s.

8.9

KristenBackupMBP:core admin$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint > meow > yargs-parser                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ is-url-superb > url-regex                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
4 vulnerabilities found - Packages audited: 913
Severity: 2 Low | 2 High
✨  Done in 1.26s.
Spokje’s picture

On the remaining yargs-parser problem: @mherchel seemed to found a way to fix that here: #3144854-6: Remove stylelint-no-browser-hacks

Spokje’s picture

Kristen Pol’s picture

Thanks @Spokje. I seem to have trouble with that patch in #3144854: Remove stylelint-no-browser-hacks. Is it working for you?

xjm’s picture

Yeah, let's leave the outstanding issue with yargs-parser out of scope here since it predates the more serious vulns we're trying to correct.

xjm’s picture

@Kristen Pol BTW, did you do a yarn install in the core directory after applying the patch and before each yarn audit? Otherwise it will have stale deps from the last branch you looked at. (It could be that I just forgot about the URL issue when reauditing 8.9.x as well.)

Kristen Pol’s picture

Thanks for the tip! Here's what I get with running yarn install --force before yarn audit. For 8.9 and 9.0, I don't see an issue open for url-regex being replaced with url-regex-safe like what's mentioned in the advisory: https://www.npmjs.com/advisories/1550.

9.2

KristenBackupMBP:core admin$ yarn install --force
yarn install v1.22.10
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
[5/5] 🔨  Rebuilding all packages...
success Saved lockfile.
✨  Done in 8.58s.
KristenBackupMBP:core admin$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
1 vulnerabilities found - Packages audited: 1139
Severity: 1 Low
✨  Done in 1.32s.

9.1

KristenBackupMBP:core admin$ yarn install --force
yarn install v1.22.10
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
[5/5] 🔨  Rebuilding all packages...
success Saved lockfile.
✨  Done in 4.62s.
KristenBackupMBP:core admin$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
1 vulnerabilities found - Packages audited: 1139
Severity: 1 Low
✨  Done in 1.49s.

9.0

KristenBackupMBP:core admin$ yarn install --force
yarn install v1.22.10
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
[5/5] 🔨  Rebuilding all packages...
success Saved lockfile.
✨  Done in 6.05s.
KristenBackupMBP:core admin$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ is-url-superb > url-regex                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
3 vulnerabilities found - Packages audited: 1050
Severity: 1 Low | 2 High
✨  Done in 1.75s.

8.9

KristenBackupMBP:core admin$ yarn install --force
yarn install v1.22.10
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
[5/5] 🔨  Rebuilding all packages...
success Saved lockfile.
✨  Done in 15.48s.
KristenBackupMBP:core admin$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint > meow > yargs-parser                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ is-url-superb > url-regex                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
4 vulnerabilities found - Packages audited: 913
Severity: 2 Low | 2 High
✨  Done in 1.27s.
Amber Himes Matz’s picture

Drupal 8.9.x

Testing patch yarn-3211810-2-8_9_x.patch.

I'm getting the same output as @Kristen Pol for yarn audit in #10. I did some digging and experimenting and found that upgrading postcss-custom-properties to version 10.0.0 upgrades postcss-values-parser to 4.0.0 which upgrades is-url-superb to 4.0.0, which is the earliest major version of is-url-superb that removes the dependency to the insecure url-regex package.

Attached is a diff of core/yarn.lock after running in the core/ directory:

yarn upgrade postcss-custom-properties@^10.0.0

...which was run after applying the patch and running yarn install.

After upgrading postcss-custom-properties to ^10.0.0, here's the output of yarn audit on the 8.9.x site:

ambermatz@drupal89x-3211810-web:/var/www/html/core$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint > meow > yargs-parser                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
2 vulnerabilities found - Packages audited: 911
Severity: 2 Low
Done in 1.09s.

As you can see, the 2 HIGH vulnerabilities for url-regex are gone, just the 2 LOW ones, which I understand are being addressed in #3144854: Remove stylelint-no-browser-hacks.

I haven't tested the 3 other patches yet, as I got caught up in the one for 8.9.x.

Kristen Pol’s picture

Status: Needs review » Needs work

Moving back to needs work based on #11.

Amber Himes Matz’s picture

Note: I didn't see the need to run a composer update after applying the patches since the patches only modify core/package.json and core/yarn.lock, so I didn't get any of the modified files mentioned in #3 (Step #3).

TL;DR: Mostly, just the same results as Kristen in #10.

9.2.x

1. Downloaded and installed Drupal via 9.2.x branch (and did a git pull to get latest changes)
2. Applied patch in #2 (yarn-3211810-2-9_2_x.patch)
3. From core directory, ran yarn install
4. Via yarn.lock, verified nightwatch is at version 1.6.3
5. From core directory, ran yarn audit

Output of yarn audit:

yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
1 vulnerabilities found - Packages audited: 1139
Severity: 1 Low

I think this is being addressed in #3144854: Remove stylelint-no-browser-hacks, so I call this a pass.

Drupal 9.1.x

1. Downloaded and installed Drupal via 9.1.x branch (and did a git pull to get latest changes)
2. Applied patch in #2 (yarn-3211810-2-9_1_x.patch)
3. From core directory, ran yarn install
4. Via yarn.lock, verified nightwatch is at version 1.6.3
5. From core directory, ran yarn audit

Output of yarn audit:

yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
1 vulnerabilities found - Packages audited: 1139
Severity: 1 Low

Also pass for same reason as above.

Drupal 9.0.x

1. Downloaded and installed Drupal via 9.0.x branch (and did a git pull to get latest changes)
2. Applied patch in #2 (yarn-3211810-2-9_0_x.patch)
3. From core directory, ran yarn install
4. Via yarn.lock, verified nightwatch is at version 1.6.3
5. From core directory, ran yarn audit

Output of yarn audit:

yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ is-url-superb > url-regex                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
3 vulnerabilities found - Packages audited: 1050
Severity: 1 Low | 2 High

Not a pass.

Drupal 8.9.x

1. Downloaded and installed Drupal via 8.9.x branch (and did a git pull to get latest changes)
2. Applied patch in #2 (yarn-3211810-2-8_9_x.patch)
3. From core directory, ran yarn install
4. Via yarn.lock, verified nightwatch is at version 1.6.3
5. From core directory, ran yarn audit

Output of yarn audit:

yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint > meow > yargs-parser                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ is-url-superb > url-regex                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
4 vulnerabilities found - Packages audited: 913
Severity: 2 Low | 2 High

Again, not a pass.

alexpott’s picture

Assigned: Unassigned » alexpott

I'm working on this.

alexpott’s picture

Here's patches that resolve the url-regex security issues on 9.0.x and 8.9.x. I've also executed: yarn run build && yarn run lint:css && yarn run lint:core-js-passing to make sure the builds are up-to-date with the packages. This has resulted in some js changes on 9.1, 9.2 and 9.3 - they can all use the same patch. On 8.9.x and 9.0.x this has also result in some CSS fixes. See the interdiffs for this.

lauriii’s picture

+++ b/core/package.json
@@ -47,7 +47,7 @@
-    "postcss-custom-properties": "^9.0.2",
+    "postcss-custom-properties": "^10.0.0",

Can we upgrade postcss-custom-properties to 10.0.0 given that it drops support for versions of Node.js that Drupal 8.9.x supports? If we do that, we should do it explicitly by mentioning it in the release notes, and changing the Node.js version requirement in the package.json.

alexpott’s picture

If we don't upgrade it we have

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ is-url-superb > url-regex                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ high          │ Regular Expression Denial of Service                         │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ No patch available                                           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ postcss-custom-properties                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ postcss-custom-properties > postcss-values-parser >          │
│               │ url-regex                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1550                        │
└───────────────┴──────────────────────────────────────────────────────────────┘

I think given these are core build tools we should update.

lauriii’s picture

I'm not against updating if the release managers are fine with that. If we increase the node.js version requirement, we should make it explicitly by updating the minimum node.js version in the package.json, and potentially mentioning in the release notes.

alexpott’s picture

Bumping the Node dependency in 8.9.x - there's no way around fixing the security issues in #17 without this. FWIW Node 10 appears to not be supported at this point either - https://nodejs.org/en/about/releases/

The other patches in #14 are fine because the minimum Node version on 9.x is 12.

catch’s picture

Since it's only a build tool, I think it's OK to update it. Or at least - given a choice between the leaving security issue and updating, we should go for updating. Untagging for release manager review.

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

I think in that case this is ready. I manually reviewed all three of the patches, and tested them manually by running the same commands listed in #15.

alexpott’s picture

When committing it is possible that the caniuse db might need to be updated - there's a patch that does this on #3212177: Update caniuse-lite as it is outdated

There is a work-around -it's slightly messed up but there you go...

  1. Apply patch
  2. cd core
  3. npx browserslist@latest --update-db
  4. revert all changes and apply patch again
  5. commit => should work.
catch’s picture

Status: Reviewed & tested by the community » Needs work

I went ahead and committed #3212177: Update caniuse-lite as it is outdated, but that means this needs a re-roll for yarn.lock...

Spokje’s picture

Assigned: Unassigned » Spokje

Re-rolling as we speak

Kristen Pol’s picture

Status: Needs work » Needs review

Thanks for the updated patches. I tested against 9.2, 9.1, 9.0, and 8.9:

9.2

KristenBackupMBP:drupal-9.2.x-dev admin$ patch -p1 < 3211810-25-9.1-x-9.2.x-9.3.x.patch 
patching file core/misc/ajax.js
patching file core/misc/jquery.cookie.shim.js
patching file core/package.json
patching file core/yarn.lock
KristenBackupMBP:drupal-9.2.x-dev admin$ cd core
KristenBackupMBP:core admin$ yarn install --force
yarn install v1.22.10
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
[5/5] 🔨  Rebuilding all packages...
success Saved lockfile.
✨  Done in 6.52s.
KristenBackupMBP:core admin$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
1 vulnerabilities found - Packages audited: 1139
Severity: 1 Low
✨  Done in 1.38s.

9.1

KristenBackupMBP:drupal-9.1.x-dev admin$ patch -p1 < 3211810-25-9.1-x-9.2.x-9.3.x.patch 
patching file core/misc/ajax.js
patching file core/misc/jquery.cookie.shim.js
patching file core/package.json
patching file core/yarn.lock
KristenBackupMBP:drupal-9.1.x-dev admin$ cd core
KristenBackupMBP:core admin$ yarn install --force
yarn install v1.22.10
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
[5/5] 🔨  Rebuilding all packages...
success Saved lockfile.
✨  Done in 4.82s.
KristenBackupMBP:core admin$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
1 vulnerabilities found - Packages audited: 1139
Severity: 1 Low
✨  Done in 1.33s.

9.0

KristenBackupMBP:drupal-9.0.x-dev admin$ patch -p1 < 3211810-25-9.0.x.patch 
patching file core/misc/ajax.js
patching file core/misc/jquery.cookie.shim.js
patching file core/package.json
patching file core/themes/claro/css/base/elements.css
patching file core/themes/claro/css/components/accordion.css
patching file core/themes/claro/css/components/button.css
patching file core/themes/claro/css/components/card.css
patching file core/themes/claro/css/components/details.css
patching file core/themes/claro/css/components/dialog.css
patching file core/themes/claro/css/components/fieldset.css
patching file core/themes/claro/css/components/form--password-confirm.css
patching file core/themes/claro/css/components/progress.css
patching file core/themes/claro/css/components/shortcut.css
patching file core/themes/claro/css/components/tabs.css
patching file core/themes/claro/css/components/vertical-tabs.css
patching file core/themes/claro/css/components/views-exposed-form.css
patching file core/themes/claro/css/layout/card-list.css
patching file core/themes/claro/css/theme/ckeditor-dialog.css
patching file core/themes/claro/css/theme/ckeditor-editor.css
patching file core/yarn.lock
KristenBackupMBP:drupal-9.0.x-dev admin$ yarn install --force
yarn install v1.22.10
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Rebuilding all packages...
success Saved lockfile.
✨  Done in 0.06s.
KristenBackupMBP:drupal-9.0.x-dev admin$ yarn audit
yarn audit v1.22.10
0 vulnerabilities found - Packages audited: 0
✨  Done in 0.31s.

8.9

KristenBackupMBP:drupal-8.9.x-dev admin$ patch -p1 < 3211810-25-8.9.x.patch 
patching file core/misc/dialog/off-canvas.reset.css
patching file core/package.json
patching file core/themes/claro/css/base/elements.css
patching file core/themes/claro/css/components/accordion.css
patching file core/themes/claro/css/components/button.css
patching file core/themes/claro/css/components/card.css
patching file core/themes/claro/css/components/details.css
patching file core/themes/claro/css/components/fieldset.css
patching file core/themes/claro/css/components/form--password-confirm.css
patching file core/themes/claro/css/components/progress.css
patching file core/themes/claro/css/components/shortcut.css
patching file core/themes/claro/css/components/tabs.css
patching file core/themes/claro/css/components/vertical-tabs.css
patching file core/themes/claro/css/components/views-exposed-form.css
patching file core/themes/claro/css/layout/card-list.css
patching file core/themes/claro/css/theme/ckeditor-dialog.css
patching file core/themes/claro/css/theme/ckeditor-editor.css
patching file core/themes/stable/css/core/dialog/off-canvas.reset.css
patching file core/yarn.lock
KristenBackupMBP:drupal-8.9.x-dev admin$ cd core
KristenBackupMBP:core admin$ yarn install --force
yarn install v1.22.10
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
[5/5] 🔨  Rebuilding all packages...
success Saved lockfile.
✨  Done in 10.96s.
KristenBackupMBP:core admin$ yarn audit
yarn audit v1.22.10
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint                                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint > meow > yargs-parser                              │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ yargs-parser                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=13.1.2 <14.0.0 || >=15.0.1 <16.0.0 || >=18.1.2             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ stylelint-no-browser-hacks                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ stylelint-no-browser-hacks > stylelint > meow > yargs-parser │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://www.npmjs.com/advisories/1500                        │
└───────────────┴──────────────────────────────────────────────────────────────┘
2 vulnerabilities found - Packages audited: 911
Severity: 2 Low
✨  Done in 1.47s.
Spokje’s picture

Status: Needs review » Needs work

Thanks for the (lightning speed) review @Kristen Pol

Seeing that the yargs-parser issue is going to be dealt with elsewhere:

Yeah, let's leave the outstanding issue with yargs-parser out of scope here since it predates the more serious vulns we're trying to correct.

Thus spoketh @xjm in #8

shouldn't this be RTBC?

Spokje’s picture

Assigned: Spokje » Unassigned
Status: Needs work » Needs review

(Reverting unwanted status change)

Kristen Pol’s picture

Even though yarn audit is looking good, unfortunately I'm not comfortable marking RTBC because there are a lot of changes to files other than core/yarn.lock and core/package.json that I'm unclear about.

alexpott’s picture

@Kristen Pol those changes come from running yarn run build - every time we make changes to the dev tools we need to run that command to transpile JS and process CSS.

Kristen Pol’s picture

Status: Needs review » Reviewed & tested by the community

@alexpott Thanks for the clarification. I assumed it was something like that but didn't want to move forward without making sure it was expected. Marking RTBC based on the yarn audit results and that yargs-parser will be handled in #3144854: Remove stylelint-no-browser-hacks.

Amber Himes Matz’s picture

+1 RTBC

I tested the patches in #25 and got the same results for yarn audit as @Kristen Pol in #26.

I also tested yarn test:nightwatch --tag core in all versions and confirmed that nightwatch tests would run after the upgrade to 1.6.3. (The tests did run; there were some test failures, but nightwatch did run.)

catch’s picture

When I try to commit the patch, core's pre-commit hooks are failing on the following:

$ cross-env BABEL_ENV=legacy node ./scripts/js/babel-es6-build.js --check --file core/misc/ajax.es6.js
[08:20:43] 'core/misc/ajax.es6.js' is being checked.
[08:20:44] 'core/misc/ajax.es6.js' is not updated.

yarn run v1.22.5
$ cross-env BABEL_ENV=legacy node ./scripts/js/babel-es6-build.js --check --file core/misc/jquery.cookie.shim.es6.js
[08:20:47] 'core/misc/jquery.cookie.shim.es6.js' is being checked.
[08:20:47] 'core/misc/jquery.cookie.shim.es6.js' is not updated.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Is this because only transpilation has failed and not the file (and if so a bug in the pre-commit hooks)?

It would be good to get this patch in before the patch releases, so ideas appreciated. It's possible to commit with the pre-commit hooks disabled of course, but would be good to understand what's going on.

Spokje’s picture

Took inspiration from #3118726-35: Upgrade to js.cookie 3 I did a yarn install && yarn run build && yarn run lint:css && yarn run lint:core-js-passing && yarn run build:js on all of the patches (note the added yarn run build:js). That didn't change any files.

My theory:

Since the JavaScript changes are only in parts of the js that is not present in the es6 counterparts, there's nothing to transpilate.
cross-env check sees that the original js has changed, checks the es6 counterpart, sees it has no changes and goes CLUNK

  • catch committed 09c38b4 on 9.3.x
    Issue #3211810 by alexpott, xjm, Spokje, Amber Himes Matz, Kristen Pol,...

  • catch committed af3f884 on 9.2.x
    Issue #3211810 by alexpott, xjm, Spokje, Amber Himes Matz, Kristen Pol,...

  • catch committed 8b5d2ac on 9.1.x
    Issue #3211810 by alexpott, xjm, Spokje, Amber Himes Matz, Kristen Pol,...

  • catch committed aea075a on 9.0.x
    Issue #3211810 by alexpott, xjm, Spokje, Amber Himes Matz, Kristen Pol,...
catch’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Needs follow-up

#34 seems like a good explanation. Since I am about 99.9% sure it is cross-env that is at fault here, I've gone ahead and committed this bypassing the pre-commit hooks. Let's open a follow-up to see if we can make cross-env a bit more forgiving.

  • catch committed e831738 on 8.9.x
    Issue #3211810 by alexpott, xjm, Spokje, Amber Himes Matz, Kristen Pol,...
catch’s picture

For the follow-up - @alexpott suggested I needed to run npx browserslist@latest --update-db

That didn't work by itself, but the following did:
(revert the commit)
1. rm -rf node_modules
2. npx browserslist@latest --update-db
3. yarn install
4. git reset --hard
5. Apply and commit patch

Doing this every commit check seems like overkill, but seems to be a cruft issue as opposed to an actual bug in cross-env.

Spokje’s picture

Do we also need an 8.9.x release notes addition about upping the minimum node.js version?

If we increase the node.js version requirement, we should make it explicitly by updating the minimum node.js version in the package.json, and potentially mentioning in the release notes.

Thus spoketh@lauriii in #18.

catch’s picture

Issue summary: View changes
Issue tags: +8.9.0 release notes

Added to the release notes snippet, and tagging.

Spokje’s picture

Tips hat @catch and silently changes the release notes tag.

longwave’s picture

This patch updated the cspell dictionaries and caused a spelling issue elsewhere in core, because only changed files are spellchecked, but that doesn't help when the dictionary itself changes: #3212521: [backport] cspell dislikes identifer in core/modules/views/src/Plugin/views/filter/FilterPluginBase.php and will fail any patch touching that file

Maybe the commit check script needs to run cspell across all of core if yarn.lock is updated?

Status: Fixed » Closed (fixed)

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

xjm’s picture

Issue tags: -Needs follow-up +Needs followup