{"id":"CVE-2026-4867","aliases":["CVE-2026-4867","GHSA-37ch-88jc-xwx2","GHSA-9wv6-86v2-598j"],"related":["CVE-2024-45296"],"kind":"vulnerability","state":"published","title":"path-to-regexp vulnerable to Regular Expression Denial of Service via multiple route parameters","summary":"Impact:\n\nA bad regular expression is generated any time you have three or more parameters within a single segment, separated by something that is not a period (.). For example, /:a-:b-:c or /:a-:b-:c-:d. The backtrack protection added in path-to-regexp@0.1.12 only prevents ambiguity for two parameters. With three or more, the generated lookahead does not block single separator characters, so capture groups overlap and cause catastrophic backtracking.\n\nPatches:\n\nUpgrade to path-to-regexp@0.1.13\n\nCustom regex patterns in route definitions (e.g., /:a-:b([^-/]+)-:c([^-/]+)) are not affected because they override the default capture group.\n\nWorkarounds:\n\nAll versions can be patched by providing a custom regular expression for parameters after the first in a single segment. As long as the custom regular expression does not match the text before the parameter, you will be safe. For example, change /:a-:b-:c to /:a-:b([^-/]+)-:c([^-/]+).\n\nIf paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Impact:\n\nA bad regular expression is generated any time you have three or more parameters within a single segment, separated by something that is not a period (.). For example, /:a-:b-:c or /:a-:b-:c-:d. The backtrack protection added in path-to-regexp@0.1.12 only prevents ambiguity for two parameters. With three or more, the generated lookahead does not block single separator characters, so capture groups overlap and cause catastrophic backtracking.\n\nPatches:\n\nUpgrade to path-to-regexp@0.1.13\n\nCustom regex patterns in route definitions (e.g., /:a-:b([^-/]+)-:c([^-/]+)) are not affected because they override the default capture group.\n\nWorkarounds:\n\nAll versions can be patched by providing a custom regular expression for parameters after the first in a single segment. As long as the custom regular expression does not match the text before the parameter, you will be safe. For example, change /:a-:b-:c to /:a-:b([^-/]+)-:c([^-/]+).\n\nIf paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nA bad regular expression is generated any time you have three or more parameters within a single segment, separated by something that is not a period (`.`). For example, `/:a-:b-:c` or `/:a-:b-:c-:d`. The backtrack protection added in `path-to-regexp@0.1.12` only prevents ambiguity for two parameters. With three or more, the generated lookahead does not block single separator characters, so capture groups overlap and cause catastrophic backtracking.\n\n### Patches\n\nUpgrade to [path-to-regexp@0.1.13](https://github.com/pillarjs/path-to-regexp/releases/tag/v.0.1.13)\n\nCustom regex patterns in route definitions (e.g., `/:a-:b([^-/]+)-:c([^-/]+)`) are not affected because they override the default capture group.\n\n### Workarounds\n\nAll versions can be patched by providing a custom regular expression for parameters after the first in a single segment. As long as the custom regular expression does not match the text before the parameter, you will be safe. For example, change `/:a-:b-:c` to `/:a-:b([^-/]+)-:c([^-/]+)`.\n\nIf paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length.\n\n### References\n\n- [GHSA-9wv6-86v2-598j](https://github.com/advisories/GHSA-9wv6-86v2-598j)\n- [Detailed blog post: ReDoS the web](https://blakeembrey.com/posts/2024-09-web-redos/)","format":"markdown","source":"ghsa"},{"lang":"en","text":"### Impact\n\nA bad regular expression is generated any time you have two parameters within a single segment, separated by something that is not a period (`.`). For example, `/:a-:b`.\n\n### Patches\n\nFor users of 0.1, upgrade to `0.1.10`. All other users should upgrade to `8.0.0`.\n\nThese versions add backtrack protection when a custom regex pattern is not provided:\n\n- [0.1.10](https://github.com/pillarjs/path-to-regexp/releases/tag/v0.1.10)\n- [1.9.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v1.9.0)\n- [3.3.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v3.3.0)\n- [6.3.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v6.3.0)\n\nThey do not protect against vulnerable user supplied capture groups. Protecting against explicit user patterns is out of scope for old versions and not considered a vulnerability.\n\nVersion [7.1.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v7.1.0) can enable `strict: true` and get an error when the regular expression might be bad.\n\nVersion [8.0.0](https://github.com/pillarjs/path-to-regexp/releases/tag/v8.0.0) removes the features that can cause a ReDoS.\n\n### Workarounds\n\nAll versions can be patched by providing a custom regular expression for parameters after the first in a single segment. As long as the custom regular expression does not match the text before the parameter, you will be safe. For example, change `/:a-:b` to `/:a-:b([^-/]+)`.\n\nIf paths cannot be rewritten and versions cannot be upgraded, another alternative is to limit the URL length. For example, halving the attack string improves performance by 4x faster.\n\n### Details\n\nUsing `/:a-:b` will produce the regular expression `/^\\/([^\\/]+?)-([^\\/]+?)\\/?$/`. This can be exploited by a path such as `/a${'-a'.repeat(8_000)}/a`. [OWASP](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) has a good example of why this occurs, but the TL;DR is the `/a` at the end ensures this route would never match but due to naive backtracking it will still attempt every combination of the `:a-:b` on the repeated 8,000 `-a`.\n\nBecause JavaScript is single threaded and regex matching runs on the main thread, poor performance will block the event loop and can lead to a DoS. In local benchmarks, exploiting the unsafe regex will result in performance that is over 1000x worse than the safe regex. In a more realistic environment using Express v4 and 10 concurrent connections, this translated to average latency of ~600ms vs 1ms.\n\n### References\n\n* [OWASP](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)\n* [Detailed blog post](https://blakeembrey.com/posts/2024-09-web-redos/)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Impacto:\n\nSe genera una expresión regular incorrecta cada vez que se tienen tres o más parámetros dentro de un único segmento, separados por algo que no sea un punto (.). Por ejemplo, /:a-:b-:c o /:a-:b-:c-:d. La protección contra retroceso añadida en path-to-regexp@0.1.12 solo previene la ambigüedad para dos parámetros. Con tres o más, el 'lookahead' generado no bloquea los caracteres separadores individuales, por lo que los grupos de captura se superponen y causan un retroceso catastrófico.\n\nParches:\n\nActualizar a path-to-regexp@0.1.13\n\nLos patrones de expresiones regulares personalizados en las definiciones de ruta (por ejemplo, /:a-:b([^-/]+)-:c([^-/]+)) no se ven afectados porque anulan el grupo de captura predeterminado.\n\nSoluciones provisionales:\n\nTodas las versiones pueden ser parcheadas proporcionando una expresión regular personalizada para los parámetros después del primero en un único segmento. Siempre y cuando la expresión regular personalizada no coincida con el texto anterior al parámetro, estará seguro. Por ejemplo, cambie /:a-:b-:c a /:a-:b([^-/]+)-:c([^-/]+).\n\nSi las rutas no pueden ser reescritas y las versiones no pueden ser actualizadas, otra alternativa es limitar la longitud de la URL.","source":"nvd"}],"published":"2024-09-09T20:19:15.000Z","modified":"2026-09-10T03:50:36.768Z","severity":{"scorer":"openjs","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"},"severities":[{"scorer":"openjs","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"},{"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:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P","rating":"HIGH"}],"cwes":["CWE-1333"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"0.1.13","status":"affected"}],"vendor":"path-to-regexp","product":"path-to-regexp","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.1.13"}],"ecosystem":"npm","package":"path-to-regexp","purl":"pkg:npm/path-to-regexp","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.2.0","status":"affected","fixed":"1.9.0"}],"ecosystem":"npm","package":"path-to-regexp","purl":"pkg:npm/path-to-regexp","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.1.10"}],"ecosystem":"npm","package":"path-to-regexp","purl":"pkg:npm/path-to-regexp","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"7.0.0","status":"affected","fixed":"8.0.0"}],"ecosystem":"npm","package":"path-to-regexp","purl":"pkg:npm/path-to-regexp","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.0.0","status":"affected","fixed":"3.3.0"}],"ecosystem":"npm","package":"path-to-regexp","purl":"pkg:npm/path-to-regexp","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"6.3.0"}],"ecosystem":"npm","package":"path-to-regexp","purl":"pkg:npm/path-to-regexp","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.1.13"}],"vendor":"pillarjs","product":"path-to-regexp","cpe":"cpe:2.3:a:pillarjs:path-to-regexp:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/advisories/GHSA-9wv6-86v2-598j","tags":["advisory","not-applicable"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://blakeembrey.com/posts/2024-09-web-redos","tags":["technical-description","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://cna.openjsf.org/security-advisories.html","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/pillarjs/path-to-regexp/security/advisories/GHSA-37ch-88jc-xwx2","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-4867","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pillarjs/path-to-regexp","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pillarjs/path-to-regexp/releases/tag/v.0.1.13","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pillarjs/path-to-regexp/security/advisories/GHSA-9wv6-86v2-598j","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-45296","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pillarjs/path-to-regexp/commit/29b96b4a1de52824e1ca0f49a701183cc4ed476f","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pillarjs/path-to-regexp/commit/60f2121e9b66b7b622cc01080df0aabda9eedee6","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pillarjs/path-to-regexp/commit/925ac8e3c5780b02f58cbd4e52f95da8ad2ac485","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pillarjs/path-to-regexp/commit/d31670ae8f6e69cbfd56e835742195b7d10942ef","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pillarjs/path-to-regexp/commit/f1253b47b347dcb909e3e80b0eb2649109e59894","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pillarjs/path-to-regexp/releases/tag/v6.3.0","tags":["web"],"sources":["ghsa"]},{"url":"https://security.netapp.com/advisory/ntap-20250124-0001","tags":["web"],"sources":["ghsa"]}],"credits":["EthanKim88","blakeembrey","UlisesGascon"],"assigner":"openjs","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-03-26T16:52:08.810Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-4867","url":"https://www.cve.org/CVERecord?id=CVE-2026-4867","licence":"CVE Terms of Use","modified":"2026-03-26T16:52:14.893Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-37ch-88jc-xwx2","url":"https://github.com/advisories/GHSA-37ch-88jc-xwx2","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:36.768Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9wv6-86v2-598j","url":"https://github.com/advisories/GHSA-9wv6-86v2-598j","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:18.832Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-4867","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-4867","licence":"Public domain","modified":"2026-06-17T10:57:21.827Z"}],"updatedAt":"2026-11-25T22:59:17.077Z","epss":{"score":0.00778,"percentile":0.57086,"date":"2026-12-02T12:00:21.000Z"}}