Vulnerability library
Security checkJuly 21, 2026

linkify-it: Quadratic-complexity DoS via the `mailto:` validator scan-loop on attacker text

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

High severitynpmlinkify-it

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

linkify-it’s schema-scan loop (.test() / .match(), the documented public API) invokes the mailto: schema validator at every mailto: occurrence in the input text. For each occurrence the validator does text.slice(pos) (an O(n) copy) and runs an email regex whose local-part class src_email_name greedily scans the entire remaining tail (O(n)) before failing. With N mailto: occurrences that is N × O(n) = O(n²).

Recommendation

Update the linkify-it package to the latest compatible version. Followings are version details:

  • Affected version(s): <= 5.0.1
  • Patched version(s): 5.0.2

References

Could your website be exposed too?

SmartScanner can check your website for linkify-it: Quadratic-complexity DoS via the `mailto:` validator scan-loop on attacker text and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated July 21, 2026