🌐 Nodejs.cn
security

2026年6月安全更新

Ulises GasconJune 30, 2026

Express 团队发布了 multer 2.2.0 和 morgan 1.11.0,解决了多部分解析和访问日志记录中的三个漏洞。

🌐 The Express team has released multer 2.2.0 and morgan 1.11.0, addressing three vulnerabilities across multipart parsing and access logging.

Warning

我们建议升级到最新版本的 multer 和 morgan 以保障你的应用安全。如果你有 package-lock.json,可以通过运行以下命令更新依赖:

🌐 We recommend upgrading to the latest versions of multer and morgan to secure your applications. If you have a package-lock.json, you can update the dependencies by running:

Terminal window
npm update multer morgan

以下漏洞已被修复:

🌐 The following vulnerabilities have been addressed:

multer 中间件中的 CVE-2026-5079(高危)

🌐 CVE-2026-5079 in multer middleware (High)

multer 版本 >= 1.0.0, < 2.2.0>= 3.0.0-alpha.1, < 3.0.0-alpha.2 易受到通过多部分表单数据中的深层嵌套字段名引起的拒绝服务攻击的影响

Multer 使用 append-field 依赖来解析字段名中的括号表示法,例如 a[b][c]。嵌套深度没有限制,因此攻击者可以发送包含字段名的多部分表单,从而强制分配深度嵌套的对象。嵌套足够深时,请求处理会消耗过多的内存和 CPU,导致拒绝服务。该漏洞影响所有通过 Multer 的解析器传递用户控制的多部分表单的使用者。

🌐 Multer uses the append-field dependency to parse bracket notation in field names such as a[b][c]. There is no limit on nesting depth, so an attacker can send a multipart form with field names that force allocation of deeply nested objects. With sufficient nesting, request handling consumes excessive memory and CPU, causing denial of service. The vulnerability affects all consumers that pass user-controlled multipart forms through multer’s parser.

受影响的版本>= 1.0.0, < 2.2.0>= 3.0.0-alpha.1, < 3.0.0-alpha.2
已修补的版本>= 2.2.0(稳定版)和 >= 3.0.0-alpha.2(测试版)

有关更多详情,请参见 GHSA-72gw-mp4g-v24j

🌐 For more details, see GHSA-72gw-mp4g-v24j.

morgan 中间件中的 CVE-2026-5078(中等)

🌐 CVE-2026-5078 in morgan middleware (Medium)

morgan 版本 >= 1.2.0, <= 1.10.1 易受到通过 :remote-user 令牌中未清理的控制字符进行日志伪造的影响

Morgan 的 :remote-user 令牌会将 Authorization 头中的 Basic 认证用户名写入日志流,而不会中和控制字符。一个包含 CR/LF 字符的精心构造的 Authorization: Basic 头可以注入伪造的日志行,破坏访问日志的一行一请求的结构。内置的 combinedcommondefaultshort 格式受到影响,以及任何包含 :remote-user 的自定义格式。

🌐 Morgan’s :remote-user token writes the Basic auth username from the Authorization header to the log stream without neutralizing control characters. A crafted Authorization: Basic header containing CR/LF characters can inject forged log lines, corrupting the one-request-per-line structure of access logs. The built-in combined, common, default, and short formats are affected, as well as any custom format that includes :remote-user.

受影响版本: >= 1.2.0, <= 1.10.1 修补版本: >= 1.11.0

有关更多详情,请参见 GHSA-4vj7-5mj6-jm8m

🌐 For more details, see GHSA-4vj7-5mj6-jm8m.

multer 中间件中的 CVE-2026-5038(中等)

🌐 CVE-2026-5038 in multer middleware (Medium)

multer 版本 >= 2.0.0-alpha.1, < 2.2.0>= 3.0.0-alpha.1, < 3.0.0-alpha.2 易受通过未完成中止上传清理的拒绝服务攻击影响

当使用 multer 的 diskStorage 引擎时,中止或格式错误的多部分上传会在磁盘上留下孤立的部分文件。清理路径不会在每个错误情况下运行,因此攻击者可以通过在上传过程中反复打开和断开连接来填满上传目录。随着时间的推移,这会耗尽磁盘空间,导致主机的服务拒绝。

🌐 When multer’s diskStorage engine is used, aborted or malformed multipart uploads leave orphaned partial files on disk. The cleanup path does not run on every error condition, so an attacker can fill the upload directory by repeatedly opening and dropping connections mid-upload. Over time this exhausts disk space, causing denial of service on the host.

受影响的版本>= 2.0.0-alpha.1, < 2.2.0>= 3.0.0-alpha.1, < 3.0.0-alpha.2 已修补的版本>= 2.2.0(稳定版)和 >= 3.0.0-alpha.2(测试版)

欲了解更多详情,请参见 GHSA-3p4h-7m6x-2hcm

🌐 For more details, see GHSA-3p4h-7m6x-2hcm.


我们建议升级到最新版本的 multer 和 morgan 以保护你的应用安全。

🌐 We recommend upgrading to the latest versions of multer and morgan to secure your applications.

有兴趣写一篇文章吗?查看我们的指南以开始吧。

阅读指南