fix(misc): address security CVE cluster (copy-webpack-plugin, koa, minimatch)#34708
fix(misc): address security CVE cluster (copy-webpack-plugin, koa, minimatch)#34708FrozenPandaz merged 1 commit intomasterfrom
Conversation
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
View your CI Pipeline Execution ↗ for commit 5091899
☁️ Nx Cloud last updated this comment at |
3650581 to
e2d8f02
Compare
|
hi @jaysoo there also security issue with serialize-javascript |
|
can we get an update on this? |
I'm taking a look. |
d9064a3 to
bc5ef99
Compare
eea2797 to
0f65682
Compare
006acbc to
60e221c
Compare
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud is proposing a fix for your failed CI:
We updated the test expectations in application.spec.ts to reflect the Next.js version bump from 16.0.1 to 16.1.6. The test was failing because it had hardcoded expectations for the old version numbers, but the PR intentionally upgraded to 16.1.6 to address critical security vulnerabilities (GHSA-9g9p-9gw9-jx7f and GHSA-5f7q-jpqc-wp7h).
Warning
❌ We could not verify this fix.
diff --git a/packages/next/src/generators/application/application.spec.ts b/packages/next/src/generators/application/application.spec.ts
index b83819564c..86b8fa31ba 100644
--- a/packages/next/src/generators/application/application.spec.ts
+++ b/packages/next/src/generators/application/application.spec.ts
@@ -644,8 +644,8 @@ describe('app', () => {
const packageJson = readJson(tree, '/package.json');
expect(packageJson).toMatchObject({
devDependencies: {
- 'eslint-config-next': '^16.0.1',
- '@next/eslint-plugin-next': '^16.0.1',
+ 'eslint-config-next': '^16.1.6',
+ '@next/eslint-plugin-next': '^16.1.6',
},
});
});
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
Or Apply changes locally with:
npx nx-cloud apply-locally vWhm-aAmI
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
…nimatch) 1. `@nx/webpack` and `@nx/next` depend on `copy-webpack-plugin@^10.2.4` which pulls `fast-glob` (supply-chain risk) and `serialize-javascript@^6.0.2` (GHSA-5c6j-r48x-rmvq, RCE). 2. `@nx/module-federation` depends on `@module-federation/enhanced@^0.21.2` (4 minor versions behind, transitively pulls vulnerable `koa@3.0.3`). 3. `@nx/node` scaffolds projects with `koa@^3.0.3` (CVE-2026-27959). 1. copy-webpack-plugin bumped to `^14.0.0`: drops `fast-glob` for `tinyglobby`, bumps `serialize-javascript` to `^7.0.3`. Verified clean via `npm audit`. 2. `@module-federation/enhanced` and `@module-federation/sdk` bumped to `^2.0.1`. Includes `resolveShare` resolver return type fix for 2.x compatibility. 3. `koaVersion` in `@nx/node` bumped to `^3.1.2` so new projects get the patched version. Note: koa CVE in `@module-federation/dts-plugin` remains an upstream issue (module-federation/core#4419 merged but not yet released). Will be resolved when upstream publishes a new version. Fixes #34632 Fixes #34621 Fixes #34701
|
@FrozenPandaz @jaysoo quick question, since the PR got merged, when would this be released? |
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
Several security-related issues reported:
copy-webpack-plugin (@nx/webpack still pins copy-webpack-plugin@^10.2.4 (keeps fast-glob in dependency tree) #34632):
@nx/webpackand@nx/nextpincopy-webpack-plugin@^10.2.4which transitively depends onserialize-javascript@^6.0.1(vulnerable) andfast-glob(supply-chain risk).koa ([CSV koa 3.0.1] @nx/module-federation@21.6.10 #34621):
@nx/module-federationtransitively pullskoa@3.0.3via@module-federation/dts-plugin, which is vulnerable to CVE-2026-27959 (Host Header Injection, fixed in koa 3.1.2).css-minimizer-webpack-plugin:
@nx/webpackpins^5.0.0which also depends on vulnerableserialize-javascript@^6.0.1.@module-federation/enhanced: Versions
<2.1.0transitively install vulnerablekoaviadts-plugin.Next.js: Versions
16.0.xare vulnerable to GHSA-9g9p-9gw9-jx7f (Image Optimizer DoS) and GHSA-5f7q-jpqc-wp7h (PPR Resume memory consumption).minimatch (minimatch still giving critical vulnerability in 10.2.1 #34701): User reports minimatch vulnerability, but the Nx pnpm catalog already pins the patched version
10.2.4. No code change needed — users should delete their lockfile and reinstall.Expected Behavior
copy-webpack-plugin bumped to
^14.0.0which usesserialize-javascript@^7.0.3(patched). AddednoErrorOnMissing: trueto all 3 copy-webpack-plugin usage sites to handle the v14 breaking change where missing glob patterns now throw errors by default.css-minimizer-webpack-plugin bumped to
^8.0.0which usesserialize-javascript@^7.0.3(patched).koa bumped to
^3.1.2in@nx/nodeversions.ts.@module-federation/dts-plugin@2.1.0completely removes koa dependency.@module-federation/enhanced, runtime, sdk bumped to
^2.1.0across all packages (@nx/module-federation,@nx/react,@nx/angular,@nx/rspack). AddednoErrorOnMissingfix for@module-federation/enhanced2.xruntime-library-control.plugin.tscompatibility.Next.js bumped to
~16.1.6andeslint-config-nextto^16.1.6.minimatch — no change needed, already resolved.
Migrations added (22.6.0-beta.10)
@nx/module-federation: Bump MF packages to^2.1.0@nx/react: Bump@module-federation/enhancedto^2.1.0@nx/angular: Bump@module-federation/enhancedto^2.1.0@nx/node: Bumpkoato^3.1.2@nx/next: Bumpnextto~16.1.6Skipped
<=0.24.2, moderate severity, dev server only): Fix requires breaking change jump from^0.19.2to0.25+. Will address separately.Testing
Created a fresh Nx workspace with all affected plugins to verify
npm auditis clean after changes:@nx/next(nextapp)@nx/webpack(webpackapp)@nx/rspack(shell, remote1, remote2 via Module Federation)@nx/module-federation(shell + remotes with MF config)@nx/react(MF host/remotes)@nx/node+ koa (api)Post-change audit result — only remaining issue is esbuild (moderate, skipped intentionally):
Related Issue(s)
Fixes #34632
Fixes #34621
Fixes #34701