GHSA-2g4f-4pwh-qvx6 CVE-2025-69873
ajv has ReDoS when using `$data` option
- Severity
- 5.5 / 10
- Medium · CVSS 4.0
- Exploit chance (EPSS)
- 0.55%
- Chance of exploitation in the next 30 days. Higher than 45.84% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Fix
8.18.0- Upgrade ajv to this version or later
Description
ajv (Another JSON Schema Validator) through version 8.17.1 is vulnerable to Regular Expression Denial of Service (ReDoS) when the $data option is enabled. The pattern keyword accepts runtime data via JSON Pointer syntax ($data reference), which is passed directly to the JavaScript RegExp() constructor without validation. An attacker can inject a malicious regex pattern (e.g., \"^(a|a)*$\") combined with crafted input to cause catastrophic backtracking. A 31-character payload causes approximately 44 seconds of CPU blocking, with each additional character doubling execution time. This enables complete denial of service with a single HTTP request against any API using ajv with $data: true for dynamic schema validation.
Affected versions
npm
| Package | Vulnerable | Fixed in |
|---|---|---|
| ajv | >= 7.0.0-alpha.0, < 8.18.0 |
8.18.0 |
| ajv | < 6.14.0 |
6.14.0 |
| ajv | >= 7.0.0-alpha.0, < 8.18.0 |
8.18.0 |
| ajv | < 6.14.0 |
6.14.0 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
ajv npm → 8.18.0
- npm
npm install ajv@8.18.0- yarn
yarn add ajv@8.18.0- pnpm
pnpm add ajv@8.18.0
Severity breakdown
CVSS 4.0 5.5
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P
- Attack vector
- Network
- Attack complexity
- Low
- Attack requirements
- None
- Privileges required
- None
- User interaction
- None
- Confidentiality (vulnerable system)
- None
- Integrity (vulnerable system)
- None
- Availability (vulnerable system)
- Low
- Confidentiality (subsequent systems)
- None
- Integrity (subsequent systems)
- None
- Availability (subsequent systems)
- None
- Exploit maturity
- Proof of concept
CVSS 3.1 2.9
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
- Attack vector
- Local
- Attack complexity
- High
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- Low
Weakness
CWE-400: Uncontrolled Resource Consumption
The product does not properly control the allocation and maintenance of a limited resource.
How to prevent it
- Architecture and Design: Design throttling mechanisms into the system architecture. The best protection is to limit the amount of resources that an unauthorized user can cause to be expended. A strong authentication and access control model will help prevent such attacks from occurring in the first place. The login application should be protected against DoS attacks as much as possible. Limiting the database access, perhaps by caching result sets, can help minimize the resources expended. To further limit the potential for a DoS attack, consider tracking the rate of requests received from users and blocking requests that exceed a defined rate threshold.
- Architecture and Design: Mitigation of resource exhaustion attacks requires that the target system either: recognizes the attack and denies that user further access for a given amount of time, or uniformly throttles all requests in order to make it more difficult to consume resources more quickly than they can again be freed. The first of these solutions is an issue in itself though, since it may allow attackers to prevent the use of the system by a particular valid user. If the attacker impersonates the valid user, they may be able to prevent the user from accessing the server in question. The second solution is simply difficult to effectively institute -- and even when properly done, it does not provide a full solution. It simply makes the attack require more resources on the part of the attacker.
- Architecture and Design: Ensure that protocols have specific limits of scale placed on them.
- Implementation: Ensure that all failures in resource allocation place the system into a safe posture.
CWE-1333: Inefficient Regular Expression Complexity
The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.
How to prevent it
- Architecture and Design: Use regular expressions that do not support backtracking, e.g. by removing nested quantifiers.
- System Configuration: Set backtracking limits in the configuration of the regular expression implementation, such as PHP's pcre.backtrack_limit. Also consider limits on execution time for the process.
- Implementation: Do not use regular expressions with untrusted input. If regular expressions must be used, avoid using backtracking in the expression.
- Implementation: Limit the length of the input that the regular expression will process.
References
Advisories
Fixes and patches
Packages
Other links
- github.com/EthanKim88/ethan-cve-disclosures/blob/main/CVE-2025-69873-ajv-ReDoS.md
- github.com/ajv-validator/ajv/releases/tag/v8.18.0
- github.com/ajv-validator/ajv/releases/tag/v6.14.0
- access.redhat.com/errata/RHSA-2026:10093
- access.redhat.com/errata/RHSA-2026:13512
- access.redhat.com/errata/RHSA-2026:14774
- access.redhat.com/errata/RHSA-2026:15091
- access.redhat.com/errata/RHSA-2026:16874
- access.redhat.com/errata/RHSA-2026:19712
- access.redhat.com/errata/RHSA-2026:26211
- access.redhat.com/errata/RHSA-2026:26214
- access.redhat.com/errata/RHSA-2026:33371
- access.redhat.com/errata/RHSA-2026:36651
- access.redhat.com/errata/RHSA-2026:40118
- access.redhat.com/errata/RHSA-2026:40945
- access.redhat.com/errata/RHSA-2026:40984
- access.redhat.com/errata/RHSA-2026:41941
- access.redhat.com/errata/RHSA-2026:41944
- access.redhat.com/errata/RHSA-2026:5168
- access.redhat.com/errata/RHSA-2026:5807
- access.redhat.com/errata/RHSA-2026:5907
- access.redhat.com/errata/RHSA-2026:5910
- access.redhat.com/errata/RHSA-2026:6192
- access.redhat.com/errata/RHSA-2026:6277
- access.redhat.com/errata/RHSA-2026:6309
- access.redhat.com/errata/RHSA-2026:6497
- access.redhat.com/errata/RHSA-2026:6567
- access.redhat.com/errata/RHSA-2026:6568
- access.redhat.com/errata/RHSA-2026:6802
- access.redhat.com/errata/RHSA-2026:7314
- access.redhat.com/errata/RHSA-2026:9742
- access.redhat.com/security/cve/CVE-2025-69873
- bugzilla.redhat.com/show_bug.cgi
- security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-69873.json
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-v88g-cgmw-v5xw Prototype Pollution in Ajv | Medium | Also affects ajv |
| GHSA-cggf-277g-3q54 pypdf has possible large memory usage when parsing page tree | High | Same weakness, CWE-400 |
| GHSA-3g3m-2fjr-6pw4 Glob: AbortSignal cancellation bypass allows post-timeout filesystem traversal | Medium | Same weakness, CWE-400 |
| GHSA-42gh-23hr-vphw pypdf has possible long runtimes when retrieving page labels | High | Same weakness, CWE-400 |
| GHSA-4vqv-7265-gm2w pypdf has possible large memory usage for exceptions in strict mode | High | Same weakness, CWE-400 |
| GHSA-62m5-6wh8-28x7 pypdf has possible long runtimes/large memory usage for encrypted PDF files | High | Same weakness, CWE-400 |
| GHSA-7wch-p9px-956x Forge: Regular expression denial of service in PEM decoding (pem.decode) | High | Same weakness, CWE-400 |
| GHSA-fw5c-8223-6h42 russh: peer-declared zero maximum packet size permanently stalls channel writes (silent AsyncWrite hang) | Medium | Same weakness, CWE-400 |
Credits: G-Rath, epoberezkin, wayne530
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor