CVE-2021-3822: Jsoneditor Denial of Service Vulnerability
MODERATECVE-2021-3822 is a MODERATE (CVSS 5.3) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Jsoneditor libraries in the npm ecosystem. The issue involves regular expression denial of service in jsoneditor. Remediation is available by upgrading affected packages to version 9.5.6.
CVE-2021-3822 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2021-3822
To remediate this vulnerability, upgrade all affected Jsoneditor dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install jsoneditor@9.5.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls jsoneditor
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-3822, inspect your project dependencies using npm:
npm ls jsoneditor
Analyze the terminal output to locate any version of Jsoneditor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.5.6), your application is affected.
Note: The npm ls jsoneditor command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Jsoneditor, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-3822 Affected Jsoneditor Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
jsoneditor
|
npm |
< 9.5.6
|
9.5.6
|
References
Frequently Asked Questions
What is CVE-2021-3822?
Which Jsoneditor versions are affected?
What version fixes CVE-2021-3822?
Is jsoneditor affected?
What is the CVSS score of CVE-2021-3822?
What CWE is associated with CVE-2021-3822?
How can I check npm dependencies for CVE-2021-3822?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hhfg-6hfc-rvxm",
"modified" : "2022-05-04T03:39:38Z",
"published" : "2021-09-29T17:15:55Z",
"aliases" : [ "CVE-2021-3822" ],
"summary" : "Regular Expression Denial of Service in jsoneditor",
"details" : "JSON Editor is a web-based tool to view, edit, format, and validate JSON. It has various modes such as a tree editor, a code editor, and a plain text editor. The jsoneditor package is vulnerable to ReDoS (regular expression denial of service). An attacker that is able to provide a crafted element as input to the getInnerText function may cause an application to consume an excessive amount of CPU. Below pinned line using vulnerable regex.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "jsoneditor"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "9.5.6"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-3822"
}, {
"type" : "WEB",
"url" : "https://github.com/josdejong/jsoneditor/commit/092e386cf49f2a1450625617da8e0137ed067c3e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/josdejong/jsoneditor"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/1e3ed803-b7ed-42f1-a4ea-c4c75da9de73"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333", "CWE-400", "CWE-697" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-09-28T20:52:54Z",
"nvd_published_at" : "2021-09-27T13:15:00Z"
}
}