CVE-2025-62380
BaseFortify
Publication date: 2025-10-15
Last updated on: 2025-10-16
Assigner: GitHub, Inc.
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| eladnava | mailgen | 2.0.31 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-79 | The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
This vulnerability is an HTML injection issue in the mailgen Node.js package versions up to 2.0.31. When generating plaintext emails using the generatePlaintext method with user-supplied content, the code tries to remove HTML tags using a regular expression. However, it fails to remove tags that contain certain Unicode line separator characters. These tags are later decoded into valid HTML, allowing unexpected HTML content to remain in what should be plaintext output. If this output is rendered in a context that interprets HTML, it can lead to execution of attacker-supplied scripts in the victim's browser.
How can this vulnerability impact me? :
This vulnerability can lead to execution of attacker-supplied scripts in the victim's browser if untrusted input is passed to mailgen's generatePlaintext method and the output is rendered in an HTML-interpreting context. This can result in cross-site scripting (XSS) attacks, potentially compromising user data, session tokens, or enabling other malicious actions within the affected application.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
You can detect this vulnerability by identifying if your project uses mailgen versions through 2.0.31 and calls the generatePlaintext method with untrusted input. Since the vulnerability involves HTML injection in plaintext emails, you can inspect generated plaintext emails for unexpected HTML content. There are no specific commands provided in the resources, but checking your package version with 'npm list mailgen' and reviewing code usage of 'generatePlaintext' with untrusted input is recommended.
What immediate steps should I take to mitigate this vulnerability?
The immediate step to mitigate this vulnerability is to upgrade mailgen to version 2.0.32 or later, where the issue is fixed. Additionally, avoid passing untrusted input to the generatePlaintext method or ensure proper sanitization before usage.