Skip to content

fix(deps): override ajv@8.18.0 (CVE-2025-69873)#4438

Merged
ScriptedAlchemy merged 14 commits intomodule-federation:mainfrom
Nsttt:fix/cve-2025-69873-enhanced-ajv-path
Feb 16, 2026
Merged

fix(deps): override ajv@8.18.0 (CVE-2025-69873)#4438
ScriptedAlchemy merged 14 commits intomodule-federation:mainfrom
Nsttt:fix/cve-2025-69873-enhanced-ajv-path

Conversation

@Nsttt
Copy link
Copy Markdown
Contributor

@Nsttt Nsttt commented Feb 13, 2026

Summary

  • mitigate CVE-2025-69873 by forcing a patched AJV version via pnpm.overrides
  • keep existing @module-federation/enhanced behavior (including the schema-utils.validate(getSchema(), ...) fallback path when precompiled checks fail)

CVE Context

  • CVE: CVE-2025-69873
  • Vendor/Product: ajv-validator / ajv
  • Type: CWE-1333 (ReDoS)
  • Affected: <= 8.17.1 when $data: true is enabled
  • Fix: ajv@8.18.0

schema-utils@4.3.3 depends on ajv@^8.9.0 and configures Ajv with $data: true, so pinning AJV to 8.18.0 removes the vulnerable AJV version from this repo's lockfile / dependency tree.

Changes

  • root package.json: pnpm.overrides.ajv = 8.18.0
  • packages/enhanced/package.json: bump dev ajv to ^8.18.0 (alignment)
  • pnpm-lock.yaml: refresh to ajv@8.18.0

Verification

  • pnpm install
  • NX_DAEMON=false pnpm run generate:schema
  • NX_DAEMON=false pnpm nx run enhanced:build
  • invalid options still throw ValidationError via schema-utils (e.g. name: 123)
  • pnpm exec tsc -p packages/enhanced/tsconfig.json --noEmit
  • NODE_OPTIONS="--experimental-vm-modules" npx rstest -c packages/enhanced/rstest.config.ts --project unit

Copilot AI review requested due to automatic review settings February 13, 2026 12:00
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 13, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 0d62954
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/699271b2e0c4fb000897ca6d
😎 Deploy Preview https://deploy-preview-4438--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 13, 2026

🦋 Changeset detected

Latest commit: 0d62954

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

This PR includes changesets to release 43 packages
Name Type
@module-federation/enhanced Patch
@module-federation/modern-js-v3 Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rspress-plugin Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
remote5 Patch
remote6 Patch
website-new Patch
@module-federation/runtime Patch
@module-federation/rspack Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/dts-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/devtools Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/data-prefetch Patch
@module-federation/error-codes Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/runtime-core Patch
create-module-federation Patch
@module-federation/cli Patch
@module-federation/treeshake-server Patch
@module-federation/treeshake-frontend Patch
@module-federation/metro Patch
@module-federation/metro-plugin-rnef Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/esbuild Patch
@module-federation/utilities 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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 033a5cb188

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request removes the direct schema-utils dependency from @module-federation/enhanced to eliminate the vulnerable schema-utils -> ajv@8.17.1 dependency path flagged for CVE-2025-69873. Since an upstream patched AJV release is not yet available, this PR takes a mitigation approach by removing the dependency entirely and implementing custom error formatting using the generated schema checker's error information.

Changes:

  • Removed schema-utils dependency from package.json and pnpm-lock.yaml
  • Replaced the getValidate() fallback mechanism with direct error formatting from generated schema check functions
  • Added custom error formatting logic (formatCheckError) that processes AJV error objects from compiled validators

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/enhanced/package.json Removed schema-utils from dependencies array
pnpm-lock.yaml Removed schema-utils entry from lockfile for enhanced package
packages/enhanced/src/utils.ts Replaced schema-utils validation with custom error formatter using generated checker errors
.changeset/fresh-hounds-fly.md Added patch changeset documenting the removal
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 13, 2026

Bundle Size Report

No bundle size changes detected.

Total dist: 6.87 MB (no change)
Total ESM gzip: 138.6 kB (no change)

@ScriptedAlchemy
Copy link
Copy Markdown
Member

@Nsttt please try passing invalid options after running generate schema command in monrepo root, try passing invalid option to pugin and ensure it sitll throws errors properly.

@Nsttt
Copy link
Copy Markdown
Contributor Author

Nsttt commented Feb 14, 2026

@Nsttt please try passing invalid options after running generate schema command in monrepo root, try passing invalid option to pugin and ensure it sitll throws errors properly.

Just did.

pnpm run generate:schema (ok; regenerated 7 schema/check files)
pnpm nx run enhanced:build (ok)

Then exercised invalid options against the built plugin:

  const { default: ModuleFederationPlugin } =
    require('./packages/enhanced/dist/src/lib/container/ModuleFederationPlugin');

  try { new ModuleFederationPlugin({ name: 123 }); } catch (e) {
    // name: ValidationError
    // message starts:
    // "Module Federation Plugin: Invalid options object."
    // "- options: {\"type\":\"string\"}"
  }

Also confirmed the “missing name” case still errors (it’s enforced in apply, not constructor/schema):

  const p = new ModuleFederationPlugin({});
  p.apply({}); // throws Error("ModuleFederationPlugin name is required")

So: generated checkers still run, and invalid options still throw with error details.

@epoberezkin
Copy link
Copy Markdown

Ajv fix for CVE-2025-69873 is released in 8.18.0.

Big thank you to @KsAkira10 and @mcollina for their help resolving the issue.

@EthanKim88 - disclosuing without contacting @tidelift or myself first is irresponsible, it creating some real damage and stress for many people and organizations. This is not what real security researchers do. It's necessary to disclose if not fixed in 90 days, even 30 days is ok in some cases, but publishing it without talking to anyone first is reckless and unethical.

@mitre must really push back against assigning CVE numbers to vulnerabilities disclosed irresponsibly and broadcasting them to the whole internet, before giving code maintainers a chance to fix.

That highlights real damage cybercriminals and script kiddies equipped with LLMs can do via adversarial analysis of opensource code. I kicked off a small side project CodeWatch addressing this problem about 2 week ago, as an experiment, and will aim to make it stable next week. It's a bit rough at the moment, but let me know if you want to experiment or help improve it - feel free to reach out via SimpleX.

cc @katz @tidelift

@Nsttt Nsttt changed the title fix(enhanced): remove schema-utils fallback to mitigate AJV CVE path fix(deps): override ajv@8.18.0 (CVE-2025-69873) Feb 14, 2026
@Nsttt
Copy link
Copy Markdown
Contributor Author

Nsttt commented Feb 14, 2026

Addressed P1 review note: restored the original schema-utils.validate(getSchema(), ...) fallback (so we revalidate precompiled-check failures and only throw if real schema fails), including the DEP_WEBPACK_PRE_COMPILED_SCHEMA_INVALID deprecation warning path. Also pinned ajv to 8.18.0 via pnpm.overrides to remove the vulnerable AJV version from the tree for schema-utils.

@Nsttt
Copy link
Copy Markdown
Contributor Author

Nsttt commented Feb 14, 2026

Follow-up: after addressing the regression concern, the PR is now dependency-only (no behavioral changes) and focuses on pinning ajv to 8.18.0 so schema-utils no longer resolves to <=8.17.1 in this repo's lockfile.

@ScriptedAlchemy
Copy link
Copy Markdown
Member

Amazing, thenks man. will merge. Feel little better about it now that it just dep bump.
Do we need to see if schema utils has a bump?

@Nsttt
Copy link
Copy Markdown
Contributor Author

Nsttt commented Feb 14, 2026

Amazing, thenks man. will merge. Feel little better about it now that it just dep bump. Do we need to see if schema utils has a bump?

Me too, now checking.

@ScriptedAlchemy
Copy link
Copy Markdown
Member

@cursoragent instead of package overrides globally, could we use packageExtentions in pnpm to just target this specific package that has the issue a make it use the non CVE dependency? Just comment back here after research

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Feb 14, 2026

Open in StackBlitz

@module-federation/devtools

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/devtools@4438

@module-federation/cli

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/cli@4438

create-module-federation

pnpm add https://pkg.pr.new/module-federation/core/create-module-federation@4438

@module-federation/data-prefetch

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/data-prefetch@4438

@module-federation/dts-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/dts-plugin@4438

@module-federation/enhanced

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/enhanced@4438

@module-federation/error-codes

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/error-codes@4438

@module-federation/managers

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/managers@4438

@module-federation/manifest

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/manifest@4438

@module-federation/metro

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/metro@4438

@module-federation/metro-plugin-rnc-cli

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/metro-plugin-rnc-cli@4438

@module-federation/metro-plugin-rnef

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/metro-plugin-rnef@4438

@module-federation/modern-js-v3

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/modern-js-v3@4438

@module-federation/retry-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/retry-plugin@4438

@module-federation/rsbuild-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/rsbuild-plugin@4438

@module-federation/rspack

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/rspack@4438

@module-federation/rspress-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/rspress-plugin@4438

@module-federation/runtime

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/runtime@4438

@module-federation/runtime-core

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/runtime-core@4438

@module-federation/runtime-tools

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/runtime-tools@4438

@module-federation/sdk

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/sdk@4438

@module-federation/third-party-dts-extractor

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/third-party-dts-extractor@4438

@module-federation/treeshake-frontend

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/treeshake-frontend@4438

@module-federation/treeshake-server

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/treeshake-server@4438

@module-federation/webpack-bundler-runtime

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/webpack-bundler-runtime@4438

@module-federation/bridge-react

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-react@4438

@module-federation/bridge-react-webpack-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-react-webpack-plugin@4438

@module-federation/bridge-shared

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-shared@4438

@module-federation/bridge-vue3

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/bridge-vue3@4438

@module-federation/inject-external-runtime-core-plugin

pnpm add https://pkg.pr.new/module-federation/core/@module-federation/inject-external-runtime-core-plugin@4438

commit: 0d62954

@ScriptedAlchemy ScriptedAlchemy merged commit a0faa70 into module-federation:main Feb 16, 2026
22 checks passed
@2heal1 2heal1 mentioned this pull request Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants