Skip to content

fix: resolve ajv ReDoS vulnerability by forcing ajv@8.18.0#26141

Merged
innerdvations merged 3 commits into
strapi:developfrom
itsmejay80:itsmejay80/fix-ajv-redos-vulnerability-25999
May 29, 2026
Merged

fix: resolve ajv ReDoS vulnerability by forcing ajv@8.18.0#26141
innerdvations merged 3 commits into
strapi:developfrom
itsmejay80:itsmejay80/fix-ajv-redos-vulnerability-25999

Conversation

@itsmejay80
Copy link
Copy Markdown
Contributor

What does it do?

Forces all ajv v8 dependencies to the patched 8.18.0 version via Yarn resolutions, preventing the vulnerable ajv@8.13.0 from being installed.

The vulnerable dependency path was:

@strapi/database -> umzug@3.8.1 -> @rushstack/ts-command-line@4.23.1
  -> @rushstack/terminal@0.14.3 -> @rushstack/node-core-library@5.10.0
    -> ajv@~8.13.0

Why is it needed?

Snyk reports ajv@8.13.0 as vulnerable to Regular Expression Denial of Service (ReDoS) with CVSS 8.2 (High severity, CWE-1333). This affects Strapi installations via the transitive dependency chain through @rushstack/node-core-library.

How to test it?

  1. Run yarn why ajv - confirm ajv@8.13.0 is no longer present
  2. Run yarn test:unit - tests continue to pass (274/289 suites pass; remaining 15 failures are pre-existing module resolution issues unrelated to this change)

Related issue(s)/PR(s)

Fixes #25999

Fixes strapi#25999

Snyk reported ajv@8.13.0 as vulnerable to Regular Expression Denial of Service (ReDoS)
(CVSS 8.2, CWE-1333). The vulnerability exists in the transitive dependency chain:

@strapi/database -> umzug@3.8.1 -> @rushstack/ts-command-line@4.23.1
  -> @rushstack/terminal@0.14.3 -> @rushstack/node-core-library@5.10.0
    -> ajv@~8.13.0

This fix forces all ajv v8 dependencies to the patched 8.18.0 version via Yarn resolutions,
which prevents the vulnerable 8.13.0 from being installed.
Copilot AI review requested due to automatic review settings April 28, 2026 00:12
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

@itsmejay80 is attempting to deploy a commit to the Strapi Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot Bot added pr: fix This PR is fixing a bug source: dependencies Source is dependency problem labels Apr 28, 2026
Copy link
Copy Markdown

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

Pins ajv to a patched version to eliminate the reported ReDoS vulnerability exposure coming from transitive dependencies (notably via @rushstack/node-core-library).

Changes:

  • Add Yarn resolutions to force ajv requests matching ^8.0.0 and ~8.13.0 to resolve to 8.18.0.
  • Update yarn.lock to remove ajv@8.13.0 and consolidate ajv v8 to 8.18.0 (with related lock entry updates such as uri-js descriptor consolidation).

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
package.json Adds Yarn resolutions to pin ajv to 8.18.0 for affected semver ranges.
yarn.lock Removes ajv@8.13.0 from the lockfile and reflects the pinned ajv@8.18.0 resolution.

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

Keep ajv@8.18.0 yarn resolutions alongside develop's webpack pin.
Regenerate yarn.lock after merge.
@innerdvations innerdvations self-assigned this May 29, 2026
@innerdvations innerdvations added this to the 5.47.1 milestone May 29, 2026
Scope v8 resolutions to patched 8.20.0 without overriding eslint's
ajv v6 dependency. Bump the direct @strapi/database ajv pin to match.
@innerdvations innerdvations enabled auto-merge (squash) May 29, 2026 09:19
@innerdvations innerdvations merged commit 424cd60 into strapi:develop May 29, 2026
97 of 98 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr: fix This PR is fixing a bug source: dependencies Source is dependency problem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Snyk recognizes a nesteed dependency as unsafe

3 participants