[Snyk] Security upgrade ajv from 5.2.3 to 8.18.0#501
Conversation
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-AJV-15274295
There was a problem hiding this comment.
Pull request overview
This PR upgrades the ajv (Another JSON Schema Validator) dependency from version 5.2.3 to 8.18.0 in the data-point package to address a high-severity Regular Expression Denial of Service (ReDoS) vulnerability (SNYK-JS-AJV-15274295).
Changes:
- Upgrade ajv from 5.2.3 to 8.18.0 in packages/data-point/package.json
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ], | ||
| "dependencies": { | ||
| "ajv": "5.2.3", | ||
| "ajv": "8.18.0", |
There was a problem hiding this comment.
The upgrade from ajv 5.2.3 to 8.18.0 introduces multiple breaking changes that are not addressed in this PR:
-
Removed
v5option: Thev5: falseoption used throughout the codebase (in factory.test.js, schema.js, and integrations.js) was removed in ajv v7. This option no longer exists and will be ignored or may cause errors. -
Error format changes: ajv v7+ changed the error object structure - the
dataPathproperty was renamed toinstancePath. The test snapshots explicitly check fordataPathin error objects, which will cause test failures. -
JSON Schema draft support: ajv v6+ dropped support for JSON Schema draft-04. The code should verify that all schemas are compatible with draft-06 or later.
-
Strict mode by default: ajv v7+ enables strict schema mode by default, which may reject previously valid schemas. The code may need to pass
strict: falsein the Ajv constructor options if relying on lenient schema validation. -
Node.js version requirement: ajv v8+ requires Node.js 12 or later, but package.json specifies
"node": ">=8".
The code in lib/entity-types/entity-schema/factory.js and resolve.js needs to be updated to handle these changes, and test snapshots need to be regenerated. Additionally, the data-point-service package also uses ajv 5.2.3 and should be upgraded in coordination with this change.
Snyk has created this PR to fix 1 vulnerabilities in the npm dependencies of this project.
Snyk changed the following file(s):
packages/data-point/package.jsonVulnerabilities that will be fixed with an upgrade:
SNYK-JS-AJV-15274295
Important
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open fix PRs.
For more information:
🧐 View latest project report
📜 Customise PR templates
🛠 Adjust project settings
📚 Read about Snyk's upgrade logic
Learn how to fix vulnerabilities with free interactive lessons:
🦉 Regular Expression Denial of Service (ReDoS)