平台
nodejs
组件
file-type
修复版本
20.0.1
21.3.2
CVE-2026-32630 describes a Denial of Service (DoS) vulnerability within the file-type Node.js module. A maliciously crafted ZIP archive can trigger excessive memory allocation during file type detection processes like fileTypeFromBuffer(), fileTypeFromBlob(), or fileTypeFromFile(). This can lead to application instability and potential crashes, particularly in applications relying on accurate file type identification. The vulnerability impacts versions of file-type prior to 21.3.2, and a fix is available in version 21.3.2.
CVE-2026-32630 在 file-type 库中允许攻击者在分析恶意 ZIP 文件时触发过多的内存增长。问题在于 file-type 如何处理已知大小的 ZIP 文件以确定其类型。虽然对于基于流的检测施加了限制,但这些限制不适用于已知大小的输入。一个小的压缩 ZIP 文件可以被设计为在检测过程中触发显著的扩展,尤其是在尝试识别 OOXML 等基于 ZIP 的格式时。这可能导致拒绝服务 (DoS) 条件,从而耗尽系统内存资源。
攻击者可以通过向使用 file-type 库来确定文件类型的应用程序发送专门设计的 ZIP 文件来利用此漏洞。ZIP 文件将被压缩为在检测过程中解压缩时需要不成比例的内存量。这可能发生在 Web 服务器、文件处理应用程序或使用 file-type 进行文件类型验证的任何系统上。利用的复杂性相对较低,仅需要创建恶意 ZIP 文件。
Applications built on Node.js that rely on the file-type module for file type identification are at risk. This includes web applications, file processing services, and any system handling user-uploaded files. Legacy applications using older versions of file-type are particularly vulnerable, as are applications that do not perform adequate input validation on uploaded files.
• nodejs / server:
ps aux | grep file-type | grep -v grep | awk '{print $2}' | xargs -n 1 node -e 'const ft = require("file-type"); console.log(ft.fileType(Buffer.alloc(0).toString())' # Check for excessive memory usage during file type detection• generic web:
curl -I 'http://your-application/file-upload' # Check for file upload endpoints
grep -i 'zip' /var/log/apache2/access.log # Monitor for ZIP file uploadsdisclosure
漏洞利用状态
EPSS
0.05% (16% 百分位)
CISA SSVC
减轻此漏洞的解决方案是将 file-type 库更新到 21.3.2 或更高版本。此版本修复了已知大小的输入缺乏扩展限制的问题,确保类型检测过程不会消耗过多的内存,即使在分析恶意 ZIP 文件时也是如此。建议尽快应用此更新以保护您的系统免受潜在攻击。此外,请审查 file-type 处理的文件的来源,以确保它们来自受信任的来源。
Actualice la biblioteca file-type a la versión 21.3.2 o superior. Esto corrige la vulnerabilidad de denegación de servicio causada por la descompresión ZIP excesiva. Puede actualizar usando npm o yarn.
漏洞分析和关键警报直接发送到您的邮箱。
它是一个 JavaScript 库,用于根据其内容确定文件的类型。它通常用于 Web 和桌面应用程序,以安全地验证和处理文件。
如果您使用的是 21.3.2 之前的 file-type 版本,则很可能受到影响。您可以使用 npm list file-type 或 yarn list file-type 检查已安装的版本。
如果无法立即更新,请考虑实施其他缓解措施,例如限制用于 file-type 进程的可用内存量。
有恶意软件分析工具可以帮助检测恶意 ZIP 文件。但是,最好的防御是保持您的库更新。
虽然该漏洞在 ZIP 文件中表现出来,但根本问题是对于已知大小的输入缺乏数据扩展限制。这可能会影响 file-type 尝试检测的其他文件格式。
CVSS 向量