CVE-2021-29060
JSON

5.3medium

Regular Expression Denial of Service (ReDOS)

Severity
5.3medium CVSS:3.1 by NVD
Exploit likelihood
3.01% (higher than 87% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GHSA-257v-vj4p-3w2h

Description

A Regular Expression Denial of Service (ReDOS) vulnerability was discovered in Color-String version 1.5.5 and below which occurs when the application is provided and checks a crafted invalid HWB string.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
color-string (npm)before 1.5.5GitHub Advisory Database
color-string_project color-stringbefore 1.5.5NVD

All scores

GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:N/A:P

Classification

What each source says

CVE List

A Regular Expression Denial of Service (ReDOS) vulnerability was discovered in Color-String version 1.5.5 and below which occurs when the application is provided and checks a crafted invalid HWB string.

GitHub Advisory Database

In the npm package color-string, there is a ReDos (Regular Expression Denial of Service) vulnerability regarding an exponential time complexity for linearly increasing input lengths for hwb() color strings.

Strings reaching more than 5000 characters would see several milliseconds of processing time; strings reaching more than 50,000 characters began seeing 1500ms (1.5s) of processing time.

The cause was due to a the regular expression that parses hwb() strings - specifically, the hue value - where the integer portion of the hue value used a 0-or-more quantifier shortly thereafter followed by a 1-or-more quantifier.

This caused excessive backtracking and a cartesian scan, resulting in exponential time complexity given a linear increase in input length.

NVD (es)

Se ha detectado una vulnerabilidad de Expresión Regular de Denegación de Servicio (ReDOS) en Color-String versión 1.5.5 y por debajo, que ocurre cuando la aplicación es proporcionada y comprueba una cadena HWB no válida diseñada

References

Sources

SourceRecordLicence
CVE ListCVE-2021-29060 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-257v-vj4p-3w2h changed 2023-11-08CC-BY-4.0
NVDCVE-2021-29060 changed 2026-06-17Public domain