Skip to content

Security: fix critical and high CVEs in transitive dependencies#485

Open
rickalee wants to merge 1 commit into10up:developfrom
rickalee:fix/security-happy-dom-form-data
Open

Security: fix critical and high CVEs in transitive dependencies#485
rickalee wants to merge 1 commit into10up:developfrom
rickalee:fix/security-happy-dom-form-data

Conversation

@rickalee
Copy link
Copy Markdown
Contributor

@rickalee rickalee commented Apr 1, 2026

Summary

  • Bumps copy-webpack-plugin from ^11 to ^14 and image-minimizer-webpack-plugin from ^3 to ^5, resolving serialize-javascript high-severity CVE in these direct deps
  • Downgrades @linaria/* from ^5 to ^4.5.4 in the 10up-theme project — linaria v5 pins happy-dom@10.x exactly, which has a critical CVE (CVE-2024-53382); v4.5.4 has no happy-dom dependency
  • Adds npm overrides block to root package.json to force patched versions of transitive deps: cross-spawn, flatted, form-data, immutable, minimatch, node-forge, path-to-regexp, picomatch, rollup, serialize-javascript, simple-git, svgo, tar-fs, ws

Result: Reduces from 60 vulnerabilities (7 critical, 24 high) to 9 vulnerabilities (0 critical, 0 high).

Remaining 9 (5 moderate, 4 low) are all in @wordpress/env and jest-environment-jsdom dev tooling with no upstream fixes available yet.

Test plan

  • All 86 toolkit tests pass (npm run test -w=packages/toolkit)
  • build-project-linaria test passes — confirms @linaria v4 correctly extracts CSS-in-JS
  • Library accordion tests pass (npm run test -w=projects/library)
  • Snapshot tests updated to reflect new plugin output from copy-webpack-plugin@14 and image-minimizer-webpack-plugin@5

🤖 Generated with Claude Code

- Bump copy-webpack-plugin from ^11 to ^14
- Bump image-minimizer-webpack-plugin from ^3 to ^5
- Downgrade @linaria/* from ^5 to ^4.5.4 in 10up-theme (removes happy-dom CVE)
- Add npm overrides for: cross-spawn, flatted, form-data, immutable,
  minimatch, node-forge, path-to-regexp, picomatch, rollup,
  serialize-javascript, simple-git, svgo, tar-fs, ws

Reduces from 60 vulnerabilities (7 critical, 24 high) to 9 (0 critical, 0 high).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 1, 2026

🦋 Changeset detected

Latest commit: 6ccd16a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
10up-toolkit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

fabiankaegy added a commit that referenced this pull request May 5, 2026
The plugin bumps from #484/#485 (copy-webpack-plugin@^14,
image-minimizer-webpack-plugin@^5) require Node >=20.9 — they call
Array.prototype.toSorted which is Node 20+. Bump engines.node to
>=20.9.0 across the root and toolkit package.json, and update the CI
matrix to test on Node 20 + 22 only (was 16/18/20/22).

This is a breaking change — bump the changeset to major.

Other fixes uncovered by getting CI green:
- Override stylelint-declaration-strict-value to ~1.10.11. The newer
  1.11.x bumped its peer requirement to stylelint>=16, conflicting with
  @10up/stylelint-config which still pins stylelint^15. Without the
  override npm install fails with ERESOLVE on Node 20+ (npm 10.8+).
- eslint --fix on packages/toolkit/config/webpack-fast-refresh.config.js
  to satisfy the prettier/prettier rule (the newer prettier resolution
  changed line-break preferences for the require.resolve call).

Verified:
- npm ci on Node 20.19.6 and Node 22.14.0 succeeds
- npm run lint passes (0 errors, 3 unrelated warnings)
- npm run build succeeds on both
- npm run test succeeds on both

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fabiankaegy added a commit that referenced this pull request May 5, 2026
Audited which overrides from #485 were still load-bearing after the
copy-webpack-plugin@^14, image-minimizer-webpack-plugin@^5, and
webpackbar@^7 bumps replaced their old transitive trees.

Kept (verified via removing them and re-auditing):
- @types/node ^20.19.0 — without it, npm ci fails with @InQuirer
  /external-editor peer-dep mismatch
- stylelint-declaration-strict-value ~1.10.11 — 1.11.x bumps stylelint
  peer to >=16, breaks @10up/stylelint-config (stylelint 15 peer)
- braces ^3.0.3, micromatch ^4.0.8, minimatch ^9.0.7,
  serialize-javascript ^7.0.5 — npm audit still surfaces these as
  high-severity if removed

Dropped (verified npm audit still reports 0 critical, 0 high without
them):
- cross-spawn, flatted, form-data, immutable, node-forge,
  path-to-regexp, picomatch, rollup, simple-git, svgo, tar-fs, ws

Net result: same 0 critical / 0 high audit, with 12 fewer overrides
to maintain.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant