HighGHSA-j3q9-mxjg-w52fCVE-2026-4926

path-to-regexp vulnerable to Denial of Service via sequential optional groups

Published 27 Mar 2026 · Updated 10 Sept 2026

Affected package

Affected
>=8.0.0 <8.4.0
Fixed in
8.4.0
Update to the fixed version for your release line, for example:npm install path-to-regexp@8.4.0

Details

Impact

A bad regular expression is generated any time you have multiple sequential optional groups (curly brace syntax), such as {a}{b}{c}:z. The generated regex grows exponentially with the number of groups, causing denial of service.

Patches

Fixed in version 8.4.0.

Workarounds

Limit the number of sequential optional groups in route patterns. Avoid passing user-controlled input as route patterns.

Is GHSA-j3q9-mxjg-w52f in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected path-to-regexp, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.