CVE-2026-59887: linkify-it ReDoS Vulnerability in Email Validation
linkify-it is a widely used JavaScript library that recognizes links in text, including email addresses. Versions before 5.0.2 contain a performance flaw in how they validate mailto: links. An attacker can craft malicious input containing many mailto: patterns that forces the validation logic to consume excessive CPU time, potentially degrading or halting services that process user-supplied text. The vulnerability requires no authentication and affects systems across the network.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Weaknesses (CWE)
- CWE-407
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-07-08 / 2026-07-10
NVD description (verbatim)
linkify-it is a links recognition library with full Unicode support. Prior to 5.0.2, the mailto: schema validator used by .test() and .match() can be invoked at every mailto: occurrence and scan the remaining input through src_email_name in lib/re.mjs, causing O(n^2) CPU consumption on crafted user text. This issue is fixed in version 5.0.2.
4 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in the mailto: schema validator invoked by the .test() and .match() methods in linkify-it prior to version 5.0.2. The src_email_name regular expression in lib/re.mjs exhibits algorithmic complexity that degrades quadratically with input length (O(n²)) when processing crafted email patterns. An attacker can supply input strings with repeated or nested mailto: constructs that force the validator to re-scan large portions of the remaining input on each match attempt, leading to CPU exhaustion. This is a regular expression denial-of-service (ReDoS) vulnerability.
Business impact
Any web application or backend service that uses linkify-it to parse or validate user-generated content (comments, chat messages, forum posts, etc.) becomes susceptible to denial-of-service attacks. A malicious actor can submit input that causes processing to hang or timeout, affecting availability. In high-traffic environments or API-driven architectures, this can cascade into broader service degradation. The impact is amplified in multi-tenant systems where a single attack affects all users.
Affected systems
linkify-it versions prior to 5.0.2 are affected. Any application that imports this library as a dependency and uses it to process untrusted input is at risk. Common use cases include Markdown processors, rich text editors, content moderation pipelines, and chat/messaging platforms. The vulnerability affects both Node.js applications and browser-based JavaScript that bundles linkify-it.
Exploitability
Exploitation is straightforward and requires no special privileges or authentication. An attacker needs only to submit specially crafted text containing mailto: patterns to any endpoint that processes the input through linkify-it's .test() or .match() methods. The attack can be launched from the network without user interaction. The CVSS vector reflects this: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. The primary barrier to exploitation is whether an application exposes linkify-it processing to untrusted input; if it does, the attack is trivial to execute.
Remediation
Upgrade linkify-it to version 5.0.2 or later. This release fixes the algorithmic complexity in src_email_name by optimizing the regular expression to avoid quadratic backtracking. After patching, verify that your application dependencies are properly resolved (especially if using lock files like package-lock.json or yarn.lock). For applications that cannot immediately upgrade, implement input validation or rate limiting on text processing endpoints to mitigate abuse.
Patch guidance
Update linkify-it via npm or your package manager: npm install linkify-it@^5.0.2. Verify the installed version with npm list linkify-it. If linkify-it is a transitive dependency (pulled in by another package), check that package's package.json or advisory to ensure it has been updated to a version that requires linkify-it 5.0.2+. Test your application's link detection functionality after patching to ensure no regressions. If you maintain your own bundled versions, regenerate bundles with the patched library.
Detection guidance
Monitor your application logs for patterns of slow or hanging requests that involve text processing with email-like patterns. If possible, implement request timeouts for endpoints that call linkify-it methods on user input. Search your codebase for direct calls to linkify-it.test() or linkify-it.match() to identify all code paths that could be affected. Check your dependency trees (npm ls linkify-it) to confirm which versions are installed in each environment. Use npm audit or similar tools to flag the vulnerability in your dependency reports.
Why prioritize this
This is a HIGH severity denial-of-service vulnerability that affects availability without requiring authentication or user interaction. The attack is trivial to execute if user input is processed through linkify-it. Organizations running public-facing services (web applications, APIs, chat platforms) that use linkify-it should prioritize patching within days, not weeks. If the library is used only in internal, trusted environments, the risk is lower but should still be addressed during the next maintenance window.
Risk score, explained
The CVSS 3.1 score of 7.5 reflects a network-exploitable, authentication-free denial-of-service condition with no impact to confidentiality or integrity. The score is elevated because the attack vector is unrestricted (AV:N), the attack complexity is low (AC:L), and availability impact is high (A:H). Contextually, the risk can be higher if your organization processes high volumes of user-supplied text or operates critical services dependent on linkify-it; conversely, the risk is lower if linkify-it is used only in isolated internal components or with pre-validated input.
Frequently asked questions
Can this vulnerability allow data theft or unauthorized access?
No. The vulnerability causes only denial-of-service by consuming CPU. It does not affect confidentiality or integrity—attackers cannot steal data or modify content through this flaw.
Do we need to patch if we only use linkify-it for internal, pre-validated input?
The risk is significantly lower in that scenario, but patching is still recommended. If your input is truly restricted and validated before reaching linkify-it, you are less exposed. However, over time, code changes or refactoring may inadvertently pass untrusted data to linkify-it, so fixing the root cause via patching is the safest approach.
Will upgrading to 5.0.2 break our application?
Version 5.0.2 is a patch release (minor version increment) and should be backward-compatible. The fix optimizes the regular expression without changing the API. Test in a staging environment first as a best practice, but breaking changes are unlikely.
How can we detect if someone has exploited this vulnerability?
Look for slow or timeout errors in logs around requests containing many mailto: patterns or email-like text. Spikes in CPU usage without corresponding legitimate traffic increases may indicate exploitation attempts. Implement request duration monitoring and alerting on text-processing endpoints.
This analysis is provided for informational purposes and represents a reasonable interpretation of the disclosed vulnerability based on available information as of the publication date. Verify all patch version numbers and remediation steps against the official vendor advisory before deploying. Test patches in non-production environments. The described impact and exploitability assume typical use cases; your specific risk may differ based on your implementation, exposure, and controls. No exploit code or weaponized proof-of-concept is provided. For the most current information, consult the official linkify-it repository and NIST CVE database. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2026-13311HIGHshell-quote Algorithmic Denial of Service Vulnerability
- CVE-2026-41850HIGHSpring Framework SpEL Denial of Service Vulnerability (CVSS 7.5)
- CVE-2026-42504HIGHMIME Header CPU Exhaustion Denial of Service – Patch Guidance
- CVE-2026-48502HIGHMessagePack for C# Stack Overflow in Timestamp Parsing
- CVE-2026-48511HIGHMessagePack for C# ExpandoObject Denial of Service
- CVE-2026-48516HIGHMessagePack for C# Hash Collision DoS Vulnerability
- CVE-2026-49293HIGHjs-toml TOML Parser CPU Exhaustion DoS (v1.1.0 and earlier)
- CVE-2026-49851HIGHMistune Markdown Parser CPU Exhaustion DoS Vulnerability