Currently in the process of setting up a preact project using preact-cli:
npx --version # 7.4.0
npx preact-cli create typescript frontend
Upon completion, the following information is provided:
...
added 1947 packages, and audited 1948 packages in 31s
129 packages are looking for funding
run `npm fund` for details
3 high severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
✔ Done!
After just completing the default setup, it's alarming to discover 3 high security vulnerabilities.
npm audit fix
...
fix available via `npm audit fix --force`
Will install <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fd8d8f989c9e89d09e9194bdcfd3cfd3cc">[email protected]</a>, which is a breaking change
Deciding to proceed with npm fix initiates a downgrade of preact-cli. Let's proceed accordingly:
npm audit fix --force
...
fix available via `npm audit fix --force`
Will install <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="740406111517005917181d34475a445a41">[email protected]</a>, which is a breaking change
node_modules/preact-cli/node_modules/webpack-dev-server/node_modules/yargs-parser
node_modules/preact-cli/node_modules/yargs-parser
yargs 4.0.0-alpha1 - 12.0.5 || 14.1.0 || 15.0.0 - 15.2.0
Depends on vulnerable versions of os-locale
Depends on vulnerable versions of yargs-parser
node_modules/preact-cli/node_modules/webpack-dev-server/node_modules/yargs
node_modules/preact-cli/node_modules/yargs
preact-cli 1.0.0 - 3.0.0-next.3
Depends on vulnerable versions of extract-text-webpack-plugin
Depends on vulnerable versions of url-loader
Depends on vulnerable versions of yargs
node_modules/preact-cli
webpack 2.1.0-beta.8 - 4.0.0-alpha.0
Depends on vulnerable versions of yargs
node_modules/preact-cli/node_modules/webpack
extract-text-webpack-plugin 2.0.0-beta.0 - 3.0.2
Depends on vulnerable versions of webpack
node_modules/preact-cli/node_modules/extract-text-webpack-plugin
webpack-dev-server 2.0.0-beta - 3.10.3
Depends on vulnerable versions of webpack
Depends on vulnerable versions of yargs
node_modules/preact-cli/node_modules/webpack-dev-server
17 vulnerabilities (7 low, 8 moderate, 2 high)
The attempt to downgrade to version 2.2.1 leads to new vulnerabilities surfacing. Reverting back to version 3.0.5 seems to resolve these issues.
This sets off a cycle as npm audit fix --force switches between versions 3.0.5 and 2.2.1 of preact-cli.
A bit of background: This appears to be a documented problem.