PortGate

Advisories · Node.js & Next.js

CVE-2024-45296 High CVSS 7.5

path-to-regexp regular-expression denial of service

Disclosed 2024 · Last reviewed 2 Dec 2026

A route pattern could make path-to-regexp spend a long time compiling or matching.

What happened

A crafted group backtracked.

Affected and patched versions

Affected
path-to-regexp before 0.1.10, 1.9.0, 3.3.0, 6.3.0, and 8.0.0.
Patched
Those releases and later on each line.

How to check your server

Check

npm ls path-to-regexp

How to fix and harden

  1. Upgrade path-to-regexp on the major Express or the router already uses.
  2. There are several fixed lines. Do not force a major upgrade that breaks the router.

Fix

npm ls path-to-regexp

Sources

Version ranges and fixes follow the vendor advisory. When a distribution backports a fix, trust its security tracker over the upstream version number. New advisories: RSS · JSON