Skip to content
DoS Disclosed report Intermediate CVE-2021-3822

Regular Expression Denial of Service in jsoneditor

The jsoneditor package contains a regular expression that is vulnerable to ReDoS. An attacker who can supply a crafted element to the getInnerText function could cause excessive CPU consumption.

josdejong/jsoneditor

Originally disclosed on huntr

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.

From the GitHub Advisory Database (GHSA-hhfg-6hfc-rvxm, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely a regular expression with catastrophic backtracking used in the getInnerText function.

Impact

An attacker could cause the application to consume excessive CPU, potentially leading to a denial of service.

What the attacker needed

Attacker can control input to getInnerText

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A regular expression is a pattern used to match text. Some patterns can take a very long time to process certain inputs, which is called a regular expression denial of service (ReDoS). Here, if an attacker can control the input to a specific function, they could make the application slow down or stop responding.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.