Skip to content

fix: patch serialize-javascript RCE and minimatch ReDoS vulnerabilities#484

Open
rickalee wants to merge 2 commits into10up:developfrom
rickalee:fix/security-serialize-javascript
Open

fix: patch serialize-javascript RCE and minimatch ReDoS vulnerabilities#484
rickalee wants to merge 2 commits into10up:developfrom
rickalee:fix/security-serialize-javascript

Conversation

@rickalee
Copy link
Copy Markdown
Contributor

@rickalee rickalee commented Mar 31, 2026

Summary

Details

serialize-javascript (GHSA-5c6j-r48x-rmvq / GHSA-qj8w-gfj5-8c6v)

copy-webpack-plugin@<=13 and image-minimizer-webpack-plugin@<=4 both depend on serialize-javascript@<=7.0.4, which has an RCE via RegExp.flags and a CPU exhaustion DoS via crafted array-like objects. The fix is serialize-javascript@7.0.5, which is pulled in by the major version bumps to both webpack plugins.

minimatch ReDoS (GHSA-3ppc-4f35-3m26 / GHSA-7r86-cg39-jmmj / GHSA-23c5-xmqv-rm74)

@typescript-eslint@^6 (a direct dependency of this toolkit) uses minimatch: ^9.0.3, which resolves into the vulnerable range 9.0.0–9.0.6. All three ReDoS CVEs are patched in minimatch@9.0.7. Adding "overrides": { "minimatch": "^9.0.7" } to the monorepo root pins the transitive dep to 9.0.9 without requiring a major @typescript-eslint or ESLint upgrade.

The long-term fix is upgrading to @typescript-eslint@8 + ESLint v10, tracked upstream in WordPress/gutenberg#64782.

Test plan

  • Run npm audit and confirm no serialize-javascript, no minimatch CVEs in the vulnerable ranges
  • Run npm run build in packages/toolkit to confirm webpack plugins still work
  • Run npm run test to confirm no regressions

🤖 Generated with Claude Code

…esolve serialize-javascript CVEs

Bumps copy-webpack-plugin ^11 -> ^14 and image-minimizer-webpack-plugin ^3.8.3 -> ^5.0.0.
Both v14/v5 declare serialize-javascript ^7.0.3 which now resolves to the patched 7.0.5,
fixing GHSA-5c6j-r48x-rmvq (RCE via RegExp.flags) and GHSA-qj8w-gfj5-8c6v (CPU exhaustion).
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 31, 2026

🦋 Changeset detected

Latest commit: b2080ba

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

@rickalee rickalee requested a review from nicholasio March 31, 2026 18:38
…86-cg39-jmmj, GHSA-23c5-xmqv-rm74

`@typescript-eslint@^6` (used by this toolkit) depends on
`minimatch: ^9.0.3`, which resolves into the vulnerable range
`9.0.0–9.0.6`. All three ReDoS CVEs are fixed in minimatch@9.0.7.

Adding `"overrides": { "minimatch": "^9.0.7" }` to the monorepo root
pins the transitive minimatch dep to 9.0.9 (current latest-v9) for all
packages in this repo, without requiring a major @typescript-eslint or
ESLint upgrade. The proper long-term fix is upgrading to
@typescript-eslint@8 once WordPress/Gutenberg completes their ESLint v10
migration (gutenberg#64782).
@rickalee rickalee changed the title fix: bump copy-webpack-plugin and image-minimizer-webpack-plugin for serialize-javascript CVE fix: patch serialize-javascript and minimatch ReDoS CVEs (GHSA-5c6j-r48x-rmvq, GHSA-qj8w-gfj5-8c6v, GHSA-3ppc-4f35-3m26, GHSA-7r86-cg39-jmmj, GHSA-23c5-xmqv-rm74) Mar 31, 2026
@rickalee rickalee changed the title fix: patch serialize-javascript and minimatch ReDoS CVEs (GHSA-5c6j-r48x-rmvq, GHSA-qj8w-gfj5-8c6v, GHSA-3ppc-4f35-3m26, GHSA-7r86-cg39-jmmj, GHSA-23c5-xmqv-rm74) fix: patch serialize-javascript RCE and minimatch ReDoS vulnerabilities Mar 31, 2026
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>
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