unstale

npm / path-to-regexp

path-to-regexp

What changed in path-to-regexp 8, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.

1 breaking2 security5 performance3 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

path-to-regexp 811 changes

Breaking changes 1

  • Limits generated combinations for optional route groups to fewer than 256, rejecting large combinations to avoid regex size explosions.

    8.4.0release notes

Security 2

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

    8.4.0security advisory

  • Restricts wildcard backtracking when a path uses more than one wildcard, addressing the listed security vulnerabilities.

    8.4.0release notessecurity advisory

Performance 5

  • Minimizes array allocations.

    8.4.2release notes

  • Reduces bundle size from 1.97 kB to 1.93 kB.

    8.4.2release notes

  • Improves compile performance by about 25%.

    8.4.2release notes

  • Removes internal tokenization during parse, which should improve parse performance by about 20%.

    8.4.2release notes

  • Deduplicates regex prefixes, resulting in shorter regular expressions for some cases using optional groups.

    8.4.0release notes

Fixes and other changes 3

  • Fixes an error caused by a trailing backslash.

    8.4.2release notes

  • Backtrack handling now allows a parameter to match itself, including matching the second underscore in /foo__.

    8.4.1release notes

  • Wildcards in non-ending mode no longer stop at the first match, avoiding truncated matches.

    8.4.1release notes