Advisory

GHSA-257v-vj4p-3w2h

Also known as: CVE-2021-29060

Summary

Regular Expression Denial of Service (ReDOS)

Details

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2021-06-22 01:14 UTC
Modified
2023-11-08 04:05 UTC

Affected packages and fixes

color-string

npm · All systems

Affected

  • introduced 0, fixed 1.5.5 (semver)

Fixed versions

1.5.5

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences