一、 漏洞 CVE-2025-62380 基础信息
漏洞信息
                                        # Mailgen 明文邮件HTML注入漏洞

## 漏洞概述

`mailgen` 是一个用于生成响应式 HTML 邮件的 Node.js 包,其版本 **2.0.31 及之前**存在 HTML 注入漏洞。在调用 `generatePlaintext` 方法生成纯文本邮件时,若输入内容由用户控制,则可能导致恶意 HTML 未被正确移除。

## 影响版本

- **受影响版本**:<= 2.0.31
- **修复版本**:2.0.32

## 漏洞细节

- `generatePlaintext` 方法尝试用正则表达式剥离 HTML 标签,并解码 HTML 实体。
- 某些包含 **Unicode 换行符** 的 HTML 标签未被正则表达式正确匹配并移除。
- 在后续 HTML 实体解码过程中,这些标签可能被还原为有效 HTML。
- 导致原本应为纯文本的内容中混入了 HTML,可能被渲染器解析执行。

## 漏洞影响

- 如果项目将 `generatePlaintext` 的返回结果用于 **HTML 上下文渲染**(如插入到网页中)且未二次转义,则会受到此漏洞影响。
- 可能导致 **攻击者注入的脚本在用户浏览器中执行**,造成 XSS 风险。
                                        
提示
尽管我们采用了先进的大模型技术,但其输出仍可能包含不准确或过时的信息。
神龙会尽力确保数据准确,但也请结合实际情况进行甄别与判断。
神龙祝您一切顺利!
漏洞标题
Mailgen has HTML Injection and XSS Filter Bypass in Plaintext Emails
来源:美国国家漏洞数据库 NVD
漏洞描述信息
mailgen is a Node.js package that generates responsive HTML e-mails for sending transactional mail. Mailgen versions through 2.0.31 contain an HTML injection vulnerability in plaintext emails generated with the generatePlaintext method when user generated content is supplied. The plaintext generation code attempts to strip HTML tags using a regular expression and then decodes HTML entities, but tags that include certain Unicode line separator characters are not matched and removed. These encoded tags are later decoded into valid HTML content, allowing unexpected HTML to remain in output intended to be plaintext. Projects are affected if they call Mailgen.generatePlaintext with untrusted input and then render or otherwise process the returned string in a context where HTML is interpreted. This can lead to execution of attacker supplied script in the victim’s browser. Version 2.0.32 fixes the issue.
来源:美国国家漏洞数据库 NVD
CVSS信息
N/A
来源:美国国家漏洞数据库 NVD
漏洞类别
在Web页面生成时对输入的转义处理不恰当(跨站脚本)
来源:美国国家漏洞数据库 NVD
漏洞标题
mailgen 跨站脚本漏洞
来源:中国国家信息安全漏洞库 CNNVD
漏洞描述信息
mailgen是Elad Nava个人开发者的一个邮件生成库。 mailgen 2.0.31及之前版本存在跨站脚本漏洞,该漏洞源于generatePlaintext方法在处理用户生成内容时未正确过滤HTML标签,可能导致跨站脚本攻击。
来源:中国国家信息安全漏洞库 CNNVD
CVSS信息
N/A
来源:中国国家信息安全漏洞库 CNNVD
漏洞类别
跨站脚本
来源:中国国家信息安全漏洞库 CNNVD
二、漏洞 CVE-2025-62380 的公开POC
# POC 描述 源链接 神龙链接
三、漏洞 CVE-2025-62380 的情报信息
四、漏洞 CVE-2025-62380 的评论

暂无评论


发表评论