REDHAT-BUG-2439070: High severity npm/ajv vulnerability
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 Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ajv (Another JSON Schema Validator)to a version that resolves this vulnerability.Fixed in 8.17.1 - Configuration
For any API using ajv dynamic schema validation, disable the $data option (set $data to false) to prevent unvalidated $data/JSON Pointer values from being passed into the JavaScript RegExp() constructor.
ajv $data option = disable
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2439070?
The severity of REDHAT-BUG-2439070 is classified as critical due to its potential for Denial of Service attacks.
How do I fix REDHAT-BUG-2439070?
To fix REDHAT-BUG-2439070, update ajv to a version above 8.17.1 where the vulnerability is patched.
Which versions of ajv are affected by REDHAT-BUG-2439070?
ajv versions up to and including 8.17.1 are affected by REDHAT-BUG-2439070.
Does REDHAT-BUG-2439070 affect other packages besides ajv?
REDHAT-BUG-2439070 specifically affects the ajv package and does not mention any other related packages.
What is the nature of the vulnerability in REDHAT-BUG-2439070?
The nature of the vulnerability in REDHAT-BUG-2439070 is a Regular Expression Denial of Service (ReDoS) caused by unsafe handling of runtime data.