Problem/Motivation
Whilst trying to update
yargs-parserto a safe version, we discovered in #15 and #16 that we won't be able to update the old version ofyargs-parserdepended on bystylelint-no-browser-hacks.
stylelint-no-browser-hackshasn't been updated in 4 years, so there's no expectation it will be in the near future. It's de-facto abandoned.It currently introduces these vulnerabilities:
$ yarn auditOutput snipped to only show
stylelint-no-browser-hacksrelated vulnerabilities.┌───────────────┬──────────────────────────────────────────────────────────────┐ │ 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 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ moderate │ Regular Expression Denial of Service │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=8.2.10 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ stylelint-no-browser-hacks │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ stylelint-no-browser-hacks > stylelint > postcss-less > │ │ │ postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1693 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ moderate │ Regular Expression Denial of Service │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=8.2.10 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ stylelint-no-browser-hacks │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ stylelint-no-browser-hacks > stylelint > postcss-safe-parser │ │ │ > postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1693 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ moderate │ Regular Expression Denial of Service │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=8.2.10 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ stylelint-no-browser-hacks │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ stylelint-no-browser-hacks > stylelint > postcss-scss > │ │ │ postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1693 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ moderate │ Regular Expression Denial of Service │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=8.2.10 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ stylelint-no-browser-hacks │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ stylelint-no-browser-hacks > stylelint > sugarss > postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1693 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ moderate │ Regular Expression Denial of Service │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=8.2.10 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ stylelint-no-browser-hacks │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ stylelint-no-browser-hacks > stylelint > postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1693 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ moderate │ Regular Expression Denial of Service │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=8.2.10 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ stylelint-no-browser-hacks │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ stylelint-no-browser-hacks > stylelint > postcss-reporter > │ │ │ postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1693 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ moderate │ Regular Expression Denial of Service │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=8.2.10 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ stylelint-no-browser-hacks │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ stylelint-no-browser-hacks > stylelint > postcss-sass > │ │ │ postcss │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1693 │ └───────────────┴──────────────────────────────────────────────────────────────┘ ┌───────────────┬──────────────────────────────────────────────────────────────┐ │ high │ Regular Expression Denial of Service in trim │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Package │ trim │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Patched in │ >=0.0.3 │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Dependency of │ stylelint-no-browser-hacks │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ Path │ stylelint-no-browser-hacks > stylelint > postcss-markdown > │ │ │ remark > remark-parse > trim │ ├───────────────┼──────────────────────────────────────────────────────────────┤ │ More info │ https://www.npmjs.com/advisories/1700 │ └───────────────┴──────────────────────────────────────────────────────────────┘Note: The
postcssrelated vulnerabilities are not caused bystylelint-no-browser-hacksalone and will be handled in #3214351: [PP-1] [security] Update postcss and locked dev dependencies to address security issues.However (especially) the "high"-rated Regular Expression Denial of Service in
trimand "low"-rated Prototype Pollution inyargs-parserare solely caused bystylelint-no-browser-hacks.Also it keeps us from moving
postcssfrom to a save version (>=8.2.10), since it has a dependency onstylehacks:^2.3which gives uspostcss@5.2.18$ npm ls postcss Drupal@ /mnt/d/htdocs/drupal/core ├── postcss@7.0.35 [snipped for sanity] ├─┬ stylelint-no-browser-hacks@1.2.1 │ ├─┬ stylehacks@2.3.2 │ │ ├── postcss@5.2.18 │ │ └─┬ postcss-reporter@1.4.1 │ │ └── postcss@5.2.18 │ └─┬ stylelint@9.10.1 │ ├── postcss@7.0.35 deduped │ ├─┬ postcss-reporter@6.0.1 │ │ └── postcss@7.0.35 deduped │ └─┬ postcss-sass@0.3.5 │ └── postcss@7.0.35 deduped [snipped for sanity]Proposed resolution
Remove
stylelint-no-browser-hacks.Removing it and running
yarn lint:cssshows the same clean result before and after removing this.Doing:
$ cp yarn.lock old.yarn.lock $ yarn remove stylelint-no-browser-hacks $ yarn-lock-diff -o old.yarn.lock -n yarn.lockProduces the following output:
┌────────────────────────────┬─────────────────────────────┬─────────────────────┐ │package name │ old version(s) │new version(s) │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │@mrmlnc/readdir-enhanced │2.2.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │@nodelib/fs.stat │[..., 2.0.4], 1.1.3 │[...], 2.0.4 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │@types/glob │7.1.3 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │@types/minimatch │3.0.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │@types/vfile-message │2.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │@types/vfile │3.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │ansi-regex │[..., 5.0.0], 4.1.0, 3.0.0, 2.1.1│[...], 5.0.0, 4.1.0, 3.0.0│ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │ansi-styles │[..., 4.3.0], 3.2.1, 2.2.1 │[...], 4.3.0, 3.2.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │arr-diff │4.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │arr-flatten │1.1.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │arr-union │3.1.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │array-find-index │1.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │array-union │[..., 2.1.0], 1.0.2 │[...], 2.1.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │array-uniq │1.0.3 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │array-unique │0.3.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │assign-symbols │1.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │astral-regex │[..., 2.0.0], 1.0.0 │[...], 2.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │atob │2.1.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │base │0.11.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │braces │[..., 3.0.2], 2.3.2 │[...], 3.0.2 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │browserslist │[..., 4.16.6], 1.7.7 │[...], 4.16.6 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │cache-base │1.0.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │call-me-maybe │1.0.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │caller-callsite │2.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │caller-path │2.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │callsites │[..., 3.1.0], 2.0.0 │[...], 3.1.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │camelcase-keys │[..., 6.2.2], 4.2.0 │[...], 6.2.2 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │camelcase │[..., 5.3.1], 4.1.0 │[...], 5.3.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │caniuse-db │1.0.30001226 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │ccount │1.1.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │chalk │[..., 4.1.1], 3.0.0, 2.4.2, 1.1.3│[...], 4.1.1, 3.0.0, 2.4.2│ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │character-entities-html4 │1.1.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │class-utils │0.3.6 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │clone-regexp │[..., 2.2.0], 1.0.1 │[...], 2.2.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │collapse-white-space │1.0.6 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │collection-visit │1.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │component-emitter │1.3.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │copy-descriptor │0.1.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │cosmiconfig │[..., 7.0.0], 5.2.1 │[...], 7.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │currently-unhandled │0.4.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │decode-uri-component │0.2.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │define-property │0.2.5, 1.0.0, 2.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │dir-glob │[..., 3.0.1], 2.2.2 │[...], 3.0.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │execall │[..., 2.0.0], 1.0.0 │[...], 2.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │expand-brackets │2.1.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │extend-shallow │2.0.1, 3.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │extglob │2.0.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │fast-glob │[..., 3.2.5], 2.2.7 │[...], 3.2.5 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │file-entry-cache │[..., 6.0.1], 4.0.0 │[...], 6.0.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │fill-range │[..., 7.0.1], 4.0.0 │[...], 7.0.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │flat-cache │[..., 3.0.4], 2.0.1 │[...], 3.0.4 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │flatted │[..., 3.1.1], 2.0.2 │[...], 3.1.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │for-in │1.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │fragment-cache │0.2.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │gather-stream │1.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │get-value │2.0.6 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │glob-parent │[..., 5.1.2], 3.1.0 │[...], 5.1.2 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │glob-to-regexp │0.3.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │globby │[..., 9.2.0] │[...] │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │has-ansi │2.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │has-flag │[..., 4.0.0], 3.0.0, 1.0.0 │[...], 4.0.0, 3.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │has-value │0.3.1, 1.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │has-values │0.1.4, 1.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │html-tags │[..., 3.1.0], 2.0.0 │[...], 3.1.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │import-fresh │[..., 3.3.0], 2.0.0 │[...], 3.3.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │import-lazy │[..., 4.0.0], 3.1.0 │[...], 4.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │indent-string │[..., 4.0.0], 3.2.0 │[...], 4.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │irregular-plurals │1.4.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-accessor-descriptor │0.1.6, 1.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-alphanumeric │1.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-buffer │[..., 2.0.5], 1.1.6 │[...], 2.0.5 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-data-descriptor │0.1.4, 1.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-descriptor │0.1.6, 1.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-directory │0.3.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-extendable │0.1.1, 1.0.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-glob │[..., 4.0.1], 3.1.0 │[...], 4.0.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-number │[..., 7.0.0], 3.0.0 │[...], 7.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-regexp │[..., 2.1.0], 1.0.0 │[...], 2.1.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-supported-regexp-flag │1.0.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-whitespace-character │1.0.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-windows │1.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │is-word-character │1.0.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │isarray │[..., 1.0.0] │[...] │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │isobject │[..., 3.0.1], 2.1.0 │[...], 3.0.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │js-base64 │2.6.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │kind-of │[..., 4.0.0], 3.2.2 │[...], 6.0.3 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │known-css-properties │[..., 0.21.0], 0.11.0 │[...], 0.21.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │leven │2.1.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │log-symbols │[..., 4.1.0], 3.0.0, 2.2.0, 1.0.2│[...], 4.1.0, 3.0.0, 2.2.0│ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │loud-rejection │1.6.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │map-cache │0.2.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │map-obj │[..., 4.2.1], 2.0.0 │[...], 4.2.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │map-visit │1.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │markdown-escapes │1.0.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │markdown-table │1.1.3 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │mdast-util-compact │1.0.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │meow │[..., 9.0.0], 5.0.0 │[...], 9.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │micromatch │[..., 4.0.4], 3.1.10 │[...], 4.0.4 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │minimist-options │[..., 4.1.0], 3.0.2 │[...], 4.1.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │mixin-deep │1.3.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │nanomatch │1.2.13 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │object-copy │0.1.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │object-visit │1.0.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │object.pick │1.3.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │parse-entities │[..., 2.0.0], 1.2.2 │[...], 2.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │pascalcase │0.1.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │path-dirname │1.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │plur │2.1.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │posix-character-classes │0.1.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │postcss-jsx │0.36.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │postcss-markdown │0.36.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │postcss-reporter │1.4.1, 6.0.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │postcss-sass │[..., 0.4.4], 0.3.5 │[...], 0.4.4 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │postcss-selector-parser │[..., 5.0.0], 3.1.2, 2.2.3 │[...], 6.0.6, 5.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │postcss │[..., 7.0.35], 5.2.18 │[...], 7.0.35 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │quick-lru │[..., 4.0.1], 1.1.0 │[...], 4.0.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │read-file-stdin │0.2.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │redent │[..., 3.0.0], 2.0.0 │[...], 3.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │regex-not │1.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │remark-parse │[..., 9.0.0], 6.0.3 │[...], 9.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │remark-stringify │[..., 9.0.1], 6.0.4 │[...], 9.0.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │remark │[..., 13.0.0], 10.0.1 │[...], 13.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │repeat-element │1.1.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │replace-ext │1.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │resolve-from │[..., 5.0.0], 4.0.0, 3.0.0 │[...], 5.0.0, 4.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │resolve-url │0.2.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │rimraf │[..., 3.0.2], 2.6.3 │[...], 3.0.2 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │safe-regex │1.1.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │set-value │2.0.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │slash │[..., 3.0.0], 2.0.0 │[...], 3.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │slice-ansi │[..., 4.0.0], 2.1.0 │[...], 4.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │snapdragon-node │2.1.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │snapdragon-util │3.0.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │snapdragon │0.8.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │source-map-resolve │0.5.3 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │source-map-url │0.4.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │split-string │3.1.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │state-toggle │1.0.3 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │static-extend │0.1.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │stringify-entities │1.3.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │strip-ansi │[..., 6.0.0], 5.2.0, 4.0.0, 3.0.1│[...], 6.0.0, 5.2.0, 4.0.0│ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │strip-indent │[..., 3.0.0], 2.0.0 │[...], 3.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │stylehacks │2.3.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │stylelint-no-browser-hacks │1.2.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │stylelint │[..., 9.10.1] │[...] │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │supports-color │[..., 6.1.0], 6.0.0, 5.5.0, 3.2.3, 2.0.0│[...], 7.2.0, 6.1.0, 6.0.0, 5.5.0│ ├────────────────────────────┼────────────────────────────────────────┼─────────────────────────────────┤ │table │[..., 6.7.1], 5.4.6 │[...], 6.7.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │to-object-path │0.3.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │to-regex-range │[..., 5.0.1], 2.1.1 │[...], 5.0.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │to-regex │3.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │trim-newlines │[..., 3.0.0], 2.0.0 │[...], 3.0.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │trim-trailing-lines │1.1.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │trim │0.0.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │unherit │1.1.3 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │unified │[..., 9.2.1], 7.1.0 │[...], 9.2.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │union-value │1.0.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │unist-util-find-all-after │[..., 3.0.2], 1.0.5 │[...], 3.0.2 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │unist-util-is │[..., 4.1.0], 3.0.0 │[...], 4.1.0 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │unist-util-remove-position │1.1.4 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │unist-util-stringify-positi…│[..., 2.0.3], 1.1.2 │[...], 2.0.3 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │unist-util-visit-parents │2.1.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │unist-util-visit │1.4.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │unset-value │1.0.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │urix │0.1.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │use │3.1.1 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │vfile-location │2.0.6 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │vfile-message │[..., 2.0.4], 1.1.1 │[...], 2.0.4 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │vfile │[..., 4.2.1], 3.0.1 │[...], 4.2.1 │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │write-file-stdout │0.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │write │1.0.3 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │x-is-string │0.1.0 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │xtend │4.0.2 │- │ ├────────────────────────────┼─────────────────────────────┼─────────────────────┤ │yargs-parser │[..., 20.2.7], 13.1.2, 10.1.0│[...], 20.2.7, 13.1.2│ └────────────────────────────┴─────────────────────────────┴─────────────────────┘As can be seen it massively reduces the amount of (mostly very old) dependencies.
TLDR:(Well, you made it until here...)
Why do you wanna get rid of
stylelint-no-browser-hacksso badly, dude?
stylelint-no-browser-hacksis de facto abandoned.stylelint-no-browser-hackscurrently introduces 2 (1 high, 1 low) vulnerabilities- Removing
stylelint-no-browser-hacksand runningyarn lint:cssshows the same clean result before and after removing this.- It is (one of the packages) preventing us to move to a safe version of
postcss.Questions
Are there css browser-hacks that we want to preserve in core?
Is there another way to check for any to verify this is safe to remove?Original IS from this issue, that was previously titled: Update yargs-parser to a safe version
Problem/Motivation
We're updating libraries that have released security releases on #3118741: [Security] Update yarn dependencies to fix security issues. The only remaining package to update was yargs-parser which is included in the dependency tree because of stylelint-no-browser-hacks.
Proposed resolution
Update stylelint-no-browser-hacks so that we can update to a safe version of yargs.
| Comment | File | Size | Author |
|---|
Issue fork drupal-3144854
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
Comment #2
lauriiiComment #3
komalk commentedI tried to use yarn upgrade-interactive to do a minimal upgrade to fix the warnings from yarn audit it is not possible.
Comment #5
mherchelAccording to CI, prev patch does not apply.
Comment #6
mherchelNot sure if I did this correctly.
It looked to me like there were a number of stylelint plugins that depended on yarg-parser, so I did a
yarn upgrade --pattern stylelint, which upgrades all of the stylelint plugins. I then verified thatyarn lint:cssstill works as expected.I also verified that the yarn.lock file says that yarg-parser was upgraded to the latest version (20.2.7)
Comment #8
kristen polThanks for the patch.
Applied it to 9.2 and it updated
core/yarn.lockas expected. Then rancomposer updateand these were updated:I see the
yargs-parserwas updated from^18.1.3to:I'm unclear why it's specified as
^20.2.3when it's using20.2.7.And, I'm not sure how to get
yarn lint:cssto work as I get errors:Also, note the
yarn auditresults from thenightwatchissue in case they are relevant:#3211810: [security] Update Nightwatch and locked dev dependencies to address security issues
Comment #9
spokje@Kristen Pol
For me the patch works.
I would say newer is better?
Not sure this step is needed.
Both with and without the
composer updatestep I get:Comment #10
spokjeHaving said that..
yarn auditstill gives a vulnerability onyargs-parseLooks like nightwatch still needs vulnerable version
yargs-parser@13.1.2So I _think_ this might need to be solved in one go in #3211810: [security] Update Nightwatch and locked dev dependencies to address security issues?
Comment #11
kristen polThanks. I must have not done all the steps before. If I do:
first then I get:
and
Comment #12
kristen pol@xjm wanted to keep yargs-parser separated out from nightwatch, so leaving this issue open, but moving it back to needs work based on #10 and #11.
Comment #13
kristen pol#3211810: [security] Update Nightwatch and locked dev dependencies to address security issues has bee fixed so this patch needs updating.
Comment #14
spokjeUsed3144854-6.patchas base for the freshly opened MR.Comment #15
spokjeOk, this was...well...interesting.
As far as I can tell, we're never going to get rid of this (low) vulnerability, unless
stylelint-no-browser-hackswill update its dependency on the version ofstylelintit is using.Seeing that
stylelint-no-browser-hackshasn't been updated in 4 years, that might not happen.So here's what's going on:
core/package.jsonrequires"stylelint-no-browser-hacks": "^1.2.1"as a devDependencystylelint-no-browser-hacksrequires"stylelint": "^9.1"as a Dependency (See here)stylelintwith that constraint is9.10.1and this requires"meow": "^5.0.0"as a Dependency (See here)meowwith that constraint isv5.0.0and this requires"yargs-parser": "^10.0.0"as a Dependency (See here)Version
10.0.0ofyargs-parserisn't in the patched version list:If I remove
"stylelint-no-browser-hacks": "^1.2.1"fromcore/package.jsonand runyarn install && yarn auditno vulnerabilities are found.So it looks like we have to either life with the vulnerability or drop using
stylelint-no-browser-hacks.Since it's only used as a devDependency for CSS linting and is not meant (and probably never used) to run on any Live site, I think the risk is very, very low.
Comment #16
zrpnrThe patch in #6 didn't apply against 9.3.x, but it also seems like it's got a lot of unrelated changes.
When I run
yarn upgrade --pattern stylelintit doesn't make a diff for yarn.lock at all.Maybe most of the changes in #6 were updated in #3211810: [security] Update Nightwatch and locked dev dependencies to address security issues which landed later.
Running
yarn upgradeis going to update all the dependencies, which is already in progress in #3210633: Update JavaScript dependencies for Drupal 9.2That also won't be able to update the old version of yargs-parser depended on by stylelint-no-browser-hacks pointed out in #15
I agree with @Spokje, we should consider dropping stylelint-no-browser-hacks, then core will only have safe versions of yargs-parser.
We already have the updated version(s) of yargs-parser through nightwatch and stylelint.
Seems like stylelint-no-browser-hacks is relatively abandoned and the stylehacks it uses is not on github anymore. I tried removing it with
yarn remove stylelint-no-browser-hacksand deleted references to it in .stylelintrc.json. Runningyarn lint:cssshowed the same clean result before and after removing this.The errors in #8 were because .stylelintrc.json still referenced this package.
Are there css browser-hacks that we want to preserve in core? Is there another way to check for any to verify this is safe to remove?
Removing this package cleans up yarn.lock a lot, removing many outdated and duplicate versions of packages we already have.
Currently yarn audit shows a vulnerability in
trimas well, which is also a dependency of stylelint-no-browser-hacks, one more good reason to remove it. See: https://www.npmjs.com/advisories/1700This patch was created by running
yarn remove stylelint-no-browser-hacksand removing all references to it in core.Comment #17
spokjeWorking on a reroll that's needed after the committing of #3210633: Update JavaScript dependencies for Drupal 9.2.
Comment #19
spokjeComment #20
spokjeComment #21
spokjeComment #22
spokjeComment #23
spokjeSetting to NR to get more eyes on this.
Comment #26
spokjeComment #27
spokjeComment #28
spokjeComment #29
zrpnrI don't think I can RTBC this, since it's a reroll of my patch in #16 but I can confirm that the @Spokje MR 679 that's currently open looks good.
Running
yarn remove stylelint-no-browser-hacksand then removing the usages incore/modules/system/tests/modules/layout_test/templates/layout-test-2col.html.twigcore/.stylelintrc.jsongave me the same result as MR 679
Comment #31
bnjmnmI rebased the MR but made no additional changes. I confirmed all
no-browser-hacksusage/mentions are removed, and pleased to see how cleaned-up yarn.lock is. I also ran an audit and confirmed everything would be addressed by #3214351: [PP-1] [security] Update postcss and locked dev dependencies to address security issues (which is blocked by this issue).The worst-case scenario of this being removed (some browser hack css) is far preferable to having an unmaintained yarn-clogging dependency.
Comment #32
spokjeYay @bnjmnm!
Comment #35
lauriiiCommitted 8dbd33a and pushed to 9.3.x and 9.2.x. Thanks!