Skip to main content
Vulnerability Database/CVE-2026-107389

CVE-2026-107389: music-metadata EBML Parser DoS Vulnerability

CVE-2026-107389 is a denial of service flaw in music-metadata affecting Matroska and WebM EBML parsing. Attackers can trigger memory exhaustion or fatal crashes through crafted media files. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-107389 Overview

CVE-2026-107389 is a denial-of-service vulnerability in music-metadata, a widely used Node.js metadata parser for audio and video media files. Versions prior to 11.16.0 contain a flaw in the Matroska and WebM Extensible Binary Meta Language (EBML) parser. The parser decodes an attacker-controlled variable-size integer (VINT) element length and uses it to allocate string tokens or Uint8Array buffers before verifying that the leaf fits within its parent container or available input. Crafted WebM, MKV, or MKA files can trigger disproportionate memory allocations, out-of-memory conditions, or an uncatchable V8 fatal abort when processed through the parseFile path on Node.js 26.7.0. The flaw is classified under [CWE-789: Memory Allocation with Excessive Size Value].

Critical Impact

A single malicious media file can crash the Node.js host process in an uncatchable manner, taking down any service that parses untrusted audio or video metadata.

Affected Products

  • music-metadata npm package versions prior to 11.16.0
  • Node.js applications invoking the parseFile API against untrusted inputs
  • Any downstream service processing WebM, MKV, or MKA media through the library

Discovery Timeline

  • 2026-10-08 - CVE-2026-107389 published to NVD
  • 2026-10-09 - Last updated in NVD database

Technical Details for CVE-2026-107389

Vulnerability Analysis

The vulnerability resides in lib/ebml/EbmlIterator.ts within the EBML parsing logic. EBML encodes element lengths as VINTs that can represent values up to 2^56-1. When the parser encounters a leaf element, it reads the declared length and passes it directly to downstream readers that allocate buffers or decode strings sized to that length. No validation confirms the length fits within the parent container or remaining input stream.

An attacker who supplies a crafted MKV, WebM, or MKA file can declare a leaf length far exceeding the actual file size. The parser attempts to allocate memory proportional to the declared length. Depending on the tokenizer and runtime, this triggers one of three failure modes: disproportionate heap growth, an out-of-memory kill, or an uncatchable V8 fatal abort on Node.js 26.7.0. The impact is availability only; no information disclosure or integrity compromise occurs.

Root Cause

The parser trusts attacker-controlled length fields in the EBML stream without validating them against the container bounds or the tokenizer's known file size. Leaf readers allocate buffers eagerly based on the declared length rather than reading incrementally or capping allocations.

Attack Vector

Exploitation requires an application to parse a malicious media file. Any service accepting user-uploaded WebM, MKV, or MKA content and invoking music-metadata for tag extraction is exposed. The attacker needs no authentication beyond the ability to supply a file to the parser.

typescript
// Patch excerpt from lib/ebml/EbmlIterator.ts
} else {
  const parser = this.parserMap.get(child.value as DataType);
  if (typeof parser === 'function') {
    // Validate before leaf readers allocate buffers or string tokens from the declared length.
    const end = Math.min(posDone, this.tokenizer.fileInfo.size ?? Number.POSITIVE_INFINITY);
    if (!Number.isSafeInteger(element.len) || element.len < 0 || element.len > end - this.tokenizer.position) {
      throw new EbmlContentError(`Invalid element length: ${element.len}`);
    }
    const value = await parser(element);
    tree[child.name] = value;
    await listener.elementValue(child, value, elementPosition);

Source: GitHub Commit 163f0133. The patch rejects any leaf whose declared length is not a safe integer or exceeds the remaining bytes between the current tokenizer position and the parent end.

Detection Methods for CVE-2026-107389

Indicators of Compromise

  • Node.js process terminations with V8 fatal error messages such as FATAL ERROR: Reached heap limit Allocation failed originating from media processing workers
  • Repeated service restarts correlated with upload or ingestion of WebM, MKV, or MKA files
  • Spikes in resident set size (RSS) immediately before process exit in services using music-metadata

Detection Strategies

  • Enumerate package.json and package-lock.json files across repositories and container images for music-metadata versions below 11.16.0
  • Instrument media ingestion pipelines to log file size, declared EBML container size, and parse outcome for anomaly review
  • Review crash dumps and container restart events for stack traces referencing EbmlIterator or parseFile

Monitoring Recommendations

  • Alert on abnormal memory consumption by Node.js workers that handle user-supplied media
  • Track orchestrator restart counts for pods or containers running the vulnerable package
  • Capture inbound media upload metadata (MIME type, declared size, source) in centralized logs for correlation with crash events

How to Mitigate CVE-2026-107389

Immediate Actions Required

  • Upgrade music-metadata to version 11.16.0 or later across all applications and container images
  • Audit transitive dependencies with npm ls music-metadata to locate indirect usage
  • Isolate media parsing workloads in sandboxed worker processes with memory limits to contain future allocation flaws

Patch Information

The fix is included in music-metadata v11.16.0 and merged via Pull Request #2735. Two commits implement the hardening: commit 163f0133 validates EBML leaf lengths before allocation, and commit 2d14dc1f reads unknown-size EBML leaves incrementally. Full technical details are in GHSA-5gfj-9q3v-qfp3.

Workarounds

  • Reject WebM, MKV, and MKA uploads at the application boundary until the upgrade is deployed
  • Enforce strict file-size limits on media uploads to reduce the window for runaway allocations
  • Run metadata parsing in a child process with --max-old-space-size set low enough to crash the worker rather than the host service
bash
# Upgrade to the patched release
npm install music-metadata@^11.16.0

# Verify the installed version
npm ls music-metadata

# Audit for remaining vulnerable instances
npm audit --production

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.