Skip to main content

Red Hat CVE-2026-32630

| EUVDEUVD-2026-12139 MEDIUM
Uncontrolled Resource Consumption (CWE-400)
2026-03-13 https://github.com/sindresorhus/file-type GHSA-j47w-4g3g-c36v
5.3
CVSS 3.1 · GitHub Advisory
View

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Impact

This vulnerability presents a moderate but material availability risk with several reinforcing signals. The CVSS 3.1 score of 5.3 (Medium) with vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L correctly reflects network-based, low-complexity exploitation requiring no privileges or user interaction, with availability impact only. The attack surface is broad since affected APIs are commonly used for file upload validation in web applications. A functional proof-of-concept exists demonstrating ~1000x amplification (255 KB input causing 257 MB memory growth), making exploitation straightforward and automatable. While no EPSS or KEV status is provided in the source data, the combination of public POC, simple exploitation mechanics, network accessibility, and common library usage patterns suggests this warrants prompt patching despite the Medium CVSS rating. The real-world priority depends on application deployment context: file upload handlers in memory-constrained environments (containers, serverless functions) face higher impact than those with abundant resources.

Exploit ScenarioDerived

An attacker uploads a carefully crafted 255 KB ZIP file to a web application that validates file types using fileTypeFromBuffer() on untrusted user submissions. During type detection, the application attempts to decompress and analyze ZIP entries such as [Content_Types].xml, triggering uncontrolled inflation that consumes approximately 257 MB of memory. If the application runs in a memory-constrained environment such as a Docker container with a 512 MB limit or a serverless function, repeated submissions of such files exhaust available memory, causing the process to crash or become unresponsive. A public proof-of-concept enables attackers to automate this attack, and the low CVSS attack complexity allows non-technical actors to exploit it.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 13, 2026

The file-type library's ZIP file type detection functions fail to limit decompression output for known-size inputs, allowing attackers to craft small compressed ZIP files that expand to hundreds of megabytes in memory during processing. Applications processing untrusted file uploads are vulnerable to denial-of-service attacks that cause excessive memory consumption and potential crashes. Public exploit code exists for this vulnerability, though a patch is available.

Earlier versions of this analysis (1)
v1 Mar 13, 2026 - 21:01 CVSS 5.3

A memory exhaustion vulnerability exists in the file-type library (versions prior to the fix) where crafted ZIP files can trigger excessive memory consumption during type detection when using fileTypeFromBuffer(), fileTypeFromBlob(), or fileTypeFromFile(). The vulnerability allows remote attackers to cause denial of service by uploading a small compressed ZIP file (approximately 255 KB) that decompresses to consume hundreds of megabytes of memory (approximately 257 MB observed), potentially degrading service or crashing memory-constrained applications. A proof-of-concept demonstrating the issue has been publicly disclosed.

RemediationAI

Upgrade the file-type package to the patched version that corrects the ZIP inflate limit enforcement for known-size inputs (apply the fix for commits following 399b0f1). Execute npm update file-type to the latest version, or specify the minimum safe version in package.json and reinstall dependencies. For environments unable to patch immediately, implement upstream mitigations by enforcing file size limits on uploads (reject files exceeding a reasonable threshold such as 10 MB), using memory limits via container settings or Node.js --max-old-space-size flag, and rate-limiting file type detection requests. Additionally, consider validating ZIP structure before invoking file-type detection, or migrating to alternative file detection mechanisms that enforce consistent resource limits across all APIs. Consult the file-type project releases page for the exact patched version number and apply it to all affected applications and deployed instances.

Affected VersionsENISA

file-type 20.0.0, < 21.3.2

Affected Packages

npm file-type fix: 21.3.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The file-type library is a Node.js package used for detecting file types based on file signatures and content analysis. The vulnerability exists in the ZIP detection logic, which is classified as CWE-400 (Uncontrolled Resource Consumption). The root cause lies in inconsistent application of decompression limits: stream-based detection enforces a maximumZipEntrySizeInBytes limit (1 MiB), but buffer-based APIs use Number.MAX_SAFE_INTEGER instead, allowing unlimited inflation of ZIP entries such as [Content_Types].xml during OOXML format detection. This discrepancy was introduced in commit 399b0f1 and affects the tokenizer's handling of known-size inputs differently from unknown-size streams. The vulnerability specifically impacts CPE contexts including Node.js-based file processing applications that depend on file-type for untrusted input validation.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 5.3 MEDIUM
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Red Hat 5.3 MEDIUM

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

Lifecycle Timeline

3
PoC Detected
Mar 17, 2026 - 19:05 vuln.today
Public exploit code
Patch released
Mar 17, 2026 - 19:05 nvd
Patch available
CVE Published
Mar 13, 2026 - 20:56 nvd
MEDIUM 5.3

DescriptionGitHub Advisory

Summary

A crafted ZIP file can trigger excessive memory growth during type detection in file-type when using fileTypeFromBuffer(), fileTypeFromBlob(), or fileTypeFromFile().

In affected versions, 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. In testing on file-type 21.3.1, a ZIP of about 255 KB caused about 257 MB of RSS growth during fileTypeFromBuffer().

This is an availability issue. Applications that use these APIs on untrusted uploads can be forced to consume large amounts of memory and may become slow or crash.

Root Cause

The ZIP detection logic applied different limits depending on whether the tokenizer had a known file size.

For stream inputs, ZIP probing was bounded by maximumZipEntrySizeInBytes (1 MiB). For known-size inputs such as buffers, blobs, and files, the code instead used Number.MAX_SAFE_INTEGER in two relevant places:

js
const maximumContentTypesEntrySize = hasUnknownFileSize(tokenizer)
	? maximumZipEntrySizeInBytes
	: Number.MAX_SAFE_INTEGER;

and:

js
const maximumLength = hasUnknownFileSize(this.tokenizer)
	? maximumZipEntrySizeInBytes
	: Number.MAX_SAFE_INTEGER;

Together, these checks allowed a crafted ZIP to bypass the intended inflate limit for known-size APIs and force large decompression during detection of entries such as [Content_Types].xml.

Proof of Concept

js
import {fileTypeFromBuffer} from 'file-type';
import archiver from 'archiver';
import {Writable} from 'node:stream';

async function createZipBomb(sizeInMegabytes) {
	return new Promise((resolve, reject) => {
		const chunks = [];
		const writable = new Writable({
			write(chunk, encoding, callback) {
				chunks.push(chunk);
				callback();
			},
		});

		const archive = archiver('zip', {zlib: {level: 9}});
		archive.pipe(writable);
		writable.on('finish', () => {
			resolve(Buffer.concat(chunks));
		});
		archive.on('error', reject);

		const xmlPrefix = '<?xml version="1.0"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">';
		const padding = Buffer.alloc(sizeInMegabytes * 1024 * 1024 - xmlPrefix.length, 0x20);
		archive.append(Buffer.concat([Buffer.from(xmlPrefix), padding]), {name: '[Content_Types].xml'});
		archive.finalize();
	});
}

const zip = await createZipBomb(256);
console.log('ZIP size (KB):', (zip.length / 1024).toFixed(0));

const before = process.memoryUsage().rss;
await fileTypeFromBuffer(zip);
const after = process.memoryUsage().rss;

console.log('RSS growth (MB):', ((after - before) / 1024 / 1024).toFixed(0));

Observed on file-type 21.3.1:

  • ZIP size: about 255 KB
  • RSS growth during detection: about 257 MB

Affected APIs

Affected:

  • fileTypeFromBuffer()
  • fileTypeFromBlob()
  • fileTypeFromFile()

Not affected:

  • fileTypeFromStream(), which already enforced the ZIP inflate limit for unknown-size inputs

Impact

Applications that inspect untrusted uploads with fileTypeFromBuffer(), fileTypeFromBlob(), or fileTypeFromFile() can be forced to consume excessive memory during ZIP-based type detection. This can degrade service or lead to process termination in memory-constrained environments.

Cause

The issue was introduced in 399b0f1

Executive ViewAI

Why It Matters

Organizations using affected should be aware of moderate risk from CVE-2026-32630, a resource exhaustion vulnerability rated CVSS 5.3. Service availability could be impacted. Proof-of-concept code is publicly available. A patch is available and should be applied during regular vulnerability management.

Business Impact: Low
Compensating Controls

Apply vendor patch. If patching is delayed: implement rate limiting and resource quotas.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Exploit
POC
Public exploit code exists
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
Low

Priority Score

46
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy