Skip to content

fix(security): update dependency ajv to v8.18.0 [security]#1495

Open
erpranavjoshi wants to merge 2 commits intoopen-feature:mainfrom
erpranavjoshi:ajv-vulnerability-fix
Open

fix(security): update dependency ajv to v8.18.0 [security]#1495
erpranavjoshi wants to merge 2 commits intoopen-feature:mainfrom
erpranavjoshi:ajv-vulnerability-fix

Conversation

@erpranavjoshi
Copy link
Copy Markdown

@erpranavjoshi erpranavjoshi commented Mar 13, 2026

This PR

Fixes security vulnerability CWE-1333: Inefficient Regular Expression Complexity

Related Issues

Notes

Follow-up Tasks

How to test

@erpranavjoshi erpranavjoshi requested review from a team as code owners March 13, 2026 10:43
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the project's security posture by upgrading a critical dependency, ajv, to its latest stable version. This update specifically targets and resolves a known vulnerability, ensuring the application benefits from the most recent security patches and improvements in schema validation.

Highlights

  • Dependency Update: The ajv package has been updated to version ^8.18.0 in package.json and 8.18.0 in package-lock.json to address a reported vulnerability.
  • Dependency Resolution: Transitive dependencies in package-lock.json were adjusted, including the addition of ajv under @verdaccio/core/node_modules and the removal of unused babel-plugin-macros and cosmiconfig entries.
Changelog
  • package-lock.json
    • Updated the ajv package version to 8.18.0.
    • Added a new ajv entry under node_modules/@verdaccio/core/node_modules with version 8.17.1.
    • Removed babel-plugin-macros and cosmiconfig entries from node_modules/jest-circus/node_modules and jest-runner/node_modules sections.
    • Updated the top-level ajv entry to 8.18.0.
    • Added ajv as a dependency under node_modules/@verdaccio/core/node_modules.
  • package.json
    • Updated the ajv dependency from ^8.12.0 to ^8.18.0.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates ajv to version 8.18.0 to address a vulnerability. The update to the direct dependency in package.json is correct. However, the changes to package-lock.json reveal that a transitive dependency is still pulling in an older version of ajv (8.17.1). My review includes a comment to address this by using npm's overrides feature to ensure the vulnerability is patched throughout the project's dependency tree.

Comment thread package-lock.json
Comment on lines +7198 to +7214
"node_modules/@verdaccio/core/node_modules/ajv": {
"version": "8.17.1",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
"integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
"dev": true,
"license": "MIT",
"dependencies": {
"fast-deep-equal": "^3.1.3",
"fast-uri": "^3.0.1",
"json-schema-traverse": "^1.0.0",
"require-from-string": "^2.0.2"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/epoberezkin"
}
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This change introduces an older version of ajv (8.17.1) as a transitive dependency via @verdaccio/core. Since this PR aims to fix a vulnerability in ajv, it's important to ensure all instances of the package are updated. To resolve this, you can add an overrides block to your package.json to force ajv to the desired version across all dependencies.

For example, in package.json:

"overrides": {
  "ajv": "^8.18.0"
}

After adding this, you will need to run npm install again to update the package-lock.json file accordingly.

@erpranavjoshi erpranavjoshi changed the title Ajv vulnerability fix fix(security): update dependency ajv to v8.18.0 [security] Mar 13, 2026
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