Vulnerability library
Security checkJanuary 24, 2025

path-to-regexp outputs backtracking regular expressions

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

High severitynpmpath-to-regexp

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

A 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.

Recommendation

Update the path-to-regexp package to the latest compatible version. Followings are version details:

  • Affected version(s): **>= 4.0.0, < 6.3.0 >= 7.0.0, < 8.0.0 >= 2.0.0, < 3.3.0 >= 0.2.0, < 1.9.0 < 0.1.10**
  • Patched version(s): **6.3.0 8.0.0 3.3.0 1.9.0 0.1.10**

References

Could your website be exposed too?

SmartScanner can check your website for path-to-regexp outputs backtracking regular expressions and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated January 24, 2025