CVE-2026-32630
Awaiting Analysis Awaiting Analysis - Queue
Excessive Memory Growth in file-type ZIP Handling (CVE

Publication date: 2026-03-16

Last updated on: 2026-03-17

Assigner: GitHub, Inc.

Description
file-type detects the file type of a file, stream, or data. From 20.0.0 to 21.3.1, a crafted ZIP file can trigger excessive memory growth during type detection in file-type when using fileTypeFromBuffer(), fileTypeFromBlob(), or fileTypeFromFile(). The ZIP inflate output limit is enforced for stream-based detection, but not for known-size inputs. As a result, a small compressed ZIP can cause file-type to inflate and process a much larger payload while probing ZIP-based formats such as OOXML. This vulnerability is fixed in 21.3.2.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-03-16
Last Modified
2026-03-17
Generated
2026-05-07
AI Q&A
2026-03-16
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
sindresorhus file-type From 20.0.0 (inc) to 21.3.2 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-409 The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

[{'type': 'paragraph', 'content': 'This vulnerability exists in the npm package "file-type" versions 20.0.0 to 21.3.1. It occurs when the package attempts to detect the file type of a crafted ZIP file using the APIs fileTypeFromBuffer(), fileTypeFromBlob(), or fileTypeFromFile().'}, {'type': 'paragraph', 'content': 'The issue arises because the code does not properly enforce limits on the size of decompressed ZIP entries for known-size inputs (buffers, blobs, files). While stream-based detection enforces a 1 MiB inflate output limit, known-size inputs use a very large limit (Number.MAX_SAFE_INTEGER), effectively disabling the limit.'}, {'type': 'paragraph', 'content': 'As a result, a small compressed ZIP file can decompress into a very large payload, causing excessive memory growth during type detection. This can be triggered by a crafted ZIP file containing a large [Content_Types].xml entry, leading to a denial-of-service condition due to high memory consumption.'}, {'type': 'paragraph', 'content': 'This vulnerability was fixed in version 21.3.2 of the file-type package.'}] [2]


How can this vulnerability impact me? :

If you use the affected versions of the file-type package to detect file types from untrusted ZIP files via fileTypeFromBuffer(), fileTypeFromBlob(), or fileTypeFromFile(), an attacker can craft a malicious ZIP file that causes your application to consume excessive memory.

This excessive memory consumption can degrade service performance or cause your application process to crash, especially in memory-constrained environments.

The vulnerability does not affect stream-based detection (fileTypeFromStream()), which correctly enforces inflate size limits.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by monitoring applications that use the file-type library versions from 20.0.0 to 21.3.1, specifically when they process ZIP files using the APIs fileTypeFromBuffer(), fileTypeFromBlob(), or fileTypeFromFile(). Detection involves identifying excessive memory usage or crashes triggered by crafted ZIP files containing a large [Content_Types].xml entry.

Since the issue arises during decompression of ZIP files, you can detect attempts to exploit it by observing processes consuming unusually high memory when handling ZIP files or by scanning for usage of vulnerable file-type versions.

Suggested commands to help detect this on a system include:

  • Check the installed version of the file-type package in your project (Node.js environment): ``` npm list file-type ```
  • Monitor memory usage of processes that handle file uploads or file-type detection, for example using: ``` top ``` or ``` ps aux --sort=-rss | head ```
  • Use system tracing or logging to detect unusually large decompression or processing of ZIP files.

No specific built-in commands or signatures are provided in the resources, so detection relies on version checking and monitoring for abnormal memory consumption during ZIP file processing.


What immediate steps should I take to mitigate this vulnerability?

The primary mitigation step is to upgrade the file-type package to version 21.3.2 or later, where this vulnerability is fixed.

Avoid processing untrusted ZIP files using the vulnerable APIs fileTypeFromBuffer(), fileTypeFromBlob(), or fileTypeFromFile() in affected versions.

If upgrading immediately is not possible, consider implementing additional controls such as limiting the size of input files, restricting ZIP file uploads, or sandboxing the file-type processing to prevent excessive memory consumption from impacting critical services.

Monitoring and alerting on abnormal memory usage during file-type detection can also help identify exploitation attempts.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart