# CVE-2026-59887: markdown-it linkify-it quadratic complexity DoS in mailto validator

Source: https://junglewise.ai/threats/cve-2026-59887-markdown-it-linkify-it-quadratic-complexity-dos-in-mailto  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-08. Updated: 2026-07-21  
License: CC BY 4.0 with a link back

CVE-2026-59887 · Severity: high · CVSS 7.5 · Published 2026-07-08

A vulnerability in the linkify-it library, commonly used in markdown editors and chat systems to detect URLs and email addresses, allows an attacker to crash or slow down a service. By providing a specially crafted text containing many "mailto:" prefixes, an attacker can force the system into a long-running calculation that blocks other users from accessing the application. This primarily impacts the availability of web platforms like forums, wikis, and comment sections.

Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-59887 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-59887 being exploited in the wild.

**How severe is CVE-2026-59887?** High severity, with a CVSS score of 7.5, published 8 July 2026.

**Which products and versions are affected?** linkify-it (npm) <= 5.0.1, SEMVER:introduced=0,fixed=5.0.2.

**Is there a fix for CVE-2026-59887?** Yes. linkify-it (npm): upgrade to 5.0.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-59887 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-59887?** Check whether you run linkify-it (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- linkify-it (npm): upgrade to 5.0.2 or later

  ```sh
  npm install linkify-it@5.0.2
  ```


## Technical details

The linkify-it library's schema-scan loop invokes the 'mailto:' validator for every occurrence of the string in the input. The validator performs an O(n) string slice and then executes a regular expression with a greedy local-part class that scans the entire remaining tail of the input. When an attacker provides N occurrences of 'mailto:', the resulting complexity is O(n²), which can block the Node.js single-threaded event loop for several seconds with relatively small inputs (e.g., ~300 KB). This is an inefficient algorithmic complexity issue (CWE-407) rooted in the 'mailto:' validation logic in index.mjs and lib/re.mjs. The vulnerability is patched in version 5.0.2 by bounding the email local-part length and optimizing the regex execution.

## Affected products

- markdown-it linkify-it <= 5.0.1

## Identifiers

- CVE-2026-59887
- GHSA-v245-v573-v5vm

## Timeline

- 2026-07-02: patched: Version 5.0.2 released
- 2026-07-08: advisory: NVD published CVE-2026-59887
- 2026-07-21: advisory: GitHub Advisory published

## References

- [https://api.github.com/users/bibu123456](https://api.github.com/users/bibu123456)
- [https://github.com/bibu123456](https://github.com/bibu123456)
- [https://api.github.com/users/bibu123456/gists%7B/gist_id%7D](https://api.github.com/users/bibu123456/gists%7B/gist_id%7D)
- [https://api.github.com/users/bibu123456/repos](https://api.github.com/users/bibu123456/repos)
- [https://avatars.githubusercontent.com/u/91076575?v=4](https://avatars.githubusercontent.com/u/91076575?v=4)
- [https://api.github.com/users/bibu123456/events%7B/privacy%7D](https://api.github.com/users/bibu123456/events%7B/privacy%7D)

## Related threats

- [markdown-it linkify-it Denial of Service via Quadratic Complexity in match loop](https://junglewise.ai/threats/cve-2026-48801-markdown-it-linkify-it-denial-of-service-via-quadratic-complexity)
