{"id":"GHSA-257v-vj4p-3w2h","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.","aliases":["CVE-2021-29060"],"modified":"2023-11-01T04:55:03.250581Z","published":"2021-06-22T01:14:09Z","database_specific":{"github_reviewed_at":"2021-06-21T23:20:37Z","nvd_published_at":"2021-06-21T16:15:00Z","cwe_ids":["CWE-770"],"severity":"MODERATE","github_reviewed":true},"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-29060"},{"type":"WEB","url":"https://github.com/Qix-/color-string/commit/0789e21284c33d89ebc4ab4ca6f759b9375ac9d3"},{"type":"WEB","url":"https://github.com/Qix-/color-string/releases/tag/1.5.5"},{"type":"WEB","url":"https://github.com/yetingli/PoCs/blob/main/CVE-2021-29060/Color-String.md"},{"type":"WEB","url":"https://github.com/yetingli/SaveResults/blob/main/js/color-string.js"},{"type":"WEB","url":"https://www.npmjs.com/package/color-string"}],"affected":[{"package":{"name":"color-string","ecosystem":"npm","purl":"pkg:npm/color-string"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.5.5"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/06/GHSA-257v-vj4p-3w2h/GHSA-257v-vj4p-3w2h.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"}]}