{"id":"CVE-2021-29060","aliases":["GHSA-257v-vj4p-3w2h"],"url":"https://o3.security/vulnerability/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\nlinearly increasing input lengths for `hwb()` color strings.\n\nStrings reaching more than 5000 characters would see several\nmilliseconds of processing time; strings reaching more than\n50,000 characters began seeing 1500ms (1.5s) of processing time.\n\nThe cause was due to a the regular expression that parses\nhwb() strings - specifically, the hue value - where\nthe integer portion of the hue value used a 0-or-more quantifier\nshortly thereafter followed by a 1-or-more quantifier.\n\nThis caused excessive backtracking and a cartesian scan,\nresulting in exponential time complexity given a linear\nincrease in input length.","published":"2021-06-21T16:15:08.113Z","modified":"2026-07-09T00:38:18.570081Z","cvss":{"score":5.3,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},"epss":{"score":0.03134,"percentile":0.8688,"asOf":"2026-08-23"},"cisaKev":null,"exploitsKnown":1,"affectedPackages":[{"ecosystem":"npm","name":"color-string","fixedVersion":"1.5.5"}],"fix":{"url":"https://github.com/Qix-/color-string/commit/0789e21284c33d89ebc4ab4ca6f759b9375ac9d3","label":"Qix-/color-string@0789e21"},"references":[{"type":"WEB","url":"https://www.npmjs.com/package/color-string"},{"type":"ADVISORY","url":"https://github.com/yetingli/SaveResults/blob/main/js/color-string.js"},{"type":"FIX","url":"https://github.com/Qix-/color-string/commit/0789e21284c33d89ebc4ab4ca6f759b9375ac9d3"},{"type":"FIX","url":"https://github.com/yetingli/PoCs/blob/main/CVE-2021-29060/Color-String.md"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29060"},{"type":"WEB","url":"https://github.com/Qix-/color-string/releases/tag/1.5.5"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-07-09T00:38:18.570081Z"}}