{"id":"CVE-2021-29060","aliases":["CVE-2021-29060","GHSA-257v-vj4p-3w2h"],"related":[],"kind":"vulnerability","state":"published","title":"Regular Expression Denial of Service (ReDOS)","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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","source":"nvd"}],"published":"2021-06-21T15:45:53.000Z","modified":"2026-06-17T03:47:13.097Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","score":5.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","score":5,"rating":"MEDIUM"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.5.5"}],"ecosystem":"npm","package":"color-string","purl":"pkg:npm/color-string","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.5.5"}],"vendor":"color-string_project","product":"color-string","cpe":"cpe:2.3:a:color-string_project:color-string:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/yetingli/SaveResults/blob/main/js/color-string.js","tags":["third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/Qix-/color-string/commit/0789e21284c33d89ebc4ab4ca6f759b9375ac9d3","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.npmjs.com/package/color-string","tags":["product","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/yetingli/PoCs/blob/main/CVE-2021-29060/Color-String.md","tags":["exploit","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29060","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/Qix-/color-string/releases/tag/1.5.5","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-29060","url":"https://www.cve.org/CVERecord?id=CVE-2021-29060","licence":"CVE Terms of Use","modified":"2024-08-03T21:55:12.637Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-257v-vj4p-3w2h","url":"https://github.com/advisories/GHSA-257v-vj4p-3w2h","licence":"CC-BY-4.0","modified":"2023-11-08T04:05:32.674Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-29060","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29060","licence":"Public domain","modified":"2026-06-17T03:47:13.097Z"}],"updatedAt":"2026-11-25T22:58:02.028Z","epss":{"score":0.03011,"percentile":0.87772,"date":"2026-12-01T12:00:22.000Z"}}