Description
Versions of the package mailparser before 3.9.3 are vulnerable to Cross-site Scripting (XSS) via the textToHtml() function due to the improper sanitisation of URLs in the email content. An attacker can execute arbitrary scripts in victim browsers by adding extra quote " to the URL with embedded malicious JavaScript code.
Published: 2026-03-03
Score: 5.1 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Cross‑Site Scripting
Action: Patch
AI Analysis

Impact

mailparser’s textToHtml() function fails to sanitize URLs correctly, allowing an attacker to inject malicious JavaScript through specially crafted email content. This cross‑site scripting flaw can execute arbitrary scripts in any browser that renders the parsed email, potentially exposing session data, credentials, or other sensitive information. The weakness is a classic client‑side XSS, identified by CWE‑79. The attack vector is not explicitly stated but inferred from the description that an attacker can supply malicious URLs in email content.

Affected Systems

The vulnerability affects the Nodemailer mailparser JavaScript library, version 3.8.x and earlier, bundled with Node.js applications. Users running any version of mailparser older than 3.9.3 are exposed, including deployments that parse inbound email into HTML for display in web interfaces. Affected systems typically include Node.js servers that process marketing or support emails.

Risk and Exploitability

With a CVSS base score of 5.1, the flaw has a medium severity and an EPSS of less than 1 %, meaning it is low probability but possible to exploit if an attacker can supply crafted email content to a susceptible application. Since the flaw is client‑side, exploitation requires a victim to view the rendered email in a browser that trusts the output; the vulnerability is not in the mailparser code itself but in how its output is consumed. The flaw is not currently listed in CISA’s Known Exploited Vulnerabilities catalog, but attackers could still target applications that fail to sanitize mailparser output. The requirement that a victim views the rendered email is inferred from the client‑side nature of the flaw.

Generated by OpenCVE AI on April 17, 2026 at 13:25 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade mailparser to version 3.9.3 or later, which contains the URL sanitization fix.
  • Ensure that any HTML rendered from mailparser is further sanitized or escaped by the web application, avoiding direct insertion into the DOM without proper encoding.
  • If an immediate upgrade is not feasible, apply a temporary workaround by stripping or neutralizing "<script>" tags and untrusted URLs from the parsed output before it reaches the browser.

Generated by OpenCVE AI on April 17, 2026 at 13:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-7gmj-h9xc-mcxc mailparser vulnerable to Cross-site Scripting
History

Fri, 17 Apr 2026 13:45:00 +0000

Type Values Removed Values Added
Title mailparser Cross‑Site Scripting via textToHtml URL Sanitization

Fri, 13 Mar 2026 18:00:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:nodemailer:mailparser:*:*:*:*:*:node.js:*:*

Wed, 04 Mar 2026 21:15:00 +0000

Type Values Removed Values Added
First Time appeared Nodemailer
Nodemailer mailparser
Vendors & Products Nodemailer
Nodemailer mailparser

Tue, 03 Mar 2026 16:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 03 Mar 2026 05:15:00 +0000

Type Values Removed Values Added
Description Versions of the package mailparser before 3.9.3 are vulnerable to Cross-site Scripting (XSS) via the textToHtml() function due to the improper sanitisation of URLs in the email content. An attacker can execute arbitrary scripts in victim browsers by adding extra quote " to the URL with embedded malicious JavaScript code.
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N/E:P'}

cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N/E:P'}


Subscriptions

Nodemailer Mailparser
cve-icon MITRE

Status: PUBLISHED

Assigner: snyk

Published:

Updated: 2026-03-03T15:17:56.714Z

Reserved: 2026-03-02T18:41:43.509Z

Link: CVE-2026-3455

cve-icon Vulnrichment

Updated: 2026-03-03T15:11:40.011Z

cve-icon NVD

Status : Analyzed

Published: 2026-03-03T05:17:25.240

Modified: 2026-03-13T17:53:26.767

Link: CVE-2026-3455

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-04-17T13:30:19Z

Weaknesses