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

CVE-2026-107388: Borewit Music-metadata DOS Vulnerability

CVE-2026-107388 is a denial of service flaw in Borewit Music-metadata that allows excessive memory allocation through malformed ID3v2 headers. This post explains its impact, affected versions, and mitigation steps.

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-107388 Overview

CVE-2026-107388 affects 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 ID3v2 parser that trusts the syncsafe tag-size field without validating it against the actual input length. A truncated file containing only an ID3v2 header can trigger an allocation of approximately 268 MiB. The library catches the resulting EndOfStreamError internally and returns a normal metadata object, masking the resource abuse from the calling application. The issue is tracked under [CWE-789: Memory Allocation with Excessive Size Value] and is fixed in version 11.16.0.

Critical Impact

An attacker-supplied media file as small as 10 bytes can force a Node.js process to allocate roughly 268 MiB of memory, enabling denial-of-service against services that parse untrusted audio or video metadata.

Affected Products

  • borewit/music-metadata versions prior to 11.16.0
  • Node.js applications and services that invoke music-metadata to parse untrusted ID3v2-tagged files
  • Downstream packages that bundle vulnerable music-metadata releases as a dependency

Discovery Timeline

  • 2026-10-08 - CVE-2026-107388 published to NVD
  • 2026-10-14 - Last updated in NVD database

Technical Details for CVE-2026-107388

Vulnerability Analysis

The music-metadata ID3v2 parser reads the syncsafe tag-size field from the file header and immediately allocates a buffer of that declared size to hold the tag body. The parser does not first check whether the remaining input stream actually contains that many bytes. A truncated file that advertises a large tag size still passes the header check, so the allocation proceeds before any data is read.

When the subsequent read reaches the end of the stream, the parser catches the resulting EndOfStreamError internally and returns a normal metadata object to the caller. The caller receives no indication that an abnormal allocation occurred. Repeated parsing of crafted files exhausts process memory and starves the Node.js event loop.

Root Cause

The root cause is missing input validation on an attacker-controlled length field. The syncsafe size encoding in ID3v2 allows values approaching 256 MiB, and the parser treated the declared value as trusted. Classified as [CWE-789], the defect allows a 10-byte input to request an allocation around 268 MiB.

Attack Vector

Exploitation requires the attacker to supply a crafted media file to an application that uses music-metadata. Typical scenarios include file upload endpoints, media library scanners, podcast or music streaming backends, and desktop apps built on Electron. Each parse of a malicious file consumes a large contiguous allocation, so concurrent or looped submissions cause memory exhaustion and process termination.

typescript
// Patch excerpt from lib/id3v2/ID3v2Parser.ts
// fix(id3v2): validate declared tag size before allocation
      throw new Id3v2ContentError('expected ID3-header file-identifier \'ID3\' was not found');
    }

    const fileSize = this.tokenizer.fileInfo.size;
    if (fileSize !== undefined) {
      const remainingBytes = fileSize - this.tokenizer.position;
      if (id3Header.size > remainingBytes) {
        throw new Id3v2ContentError(`ID3v2 tag size ${id3Header.size} exceeds remaining file size ${remainingBytes}`);
      }
    }

    this.id3Header = id3Header;

    this.headerType = (`ID3v2.${id3Header.version.major}`) as TagType;

Source: GitHub commit b033db6. The patch compares the declared id3Header.size against the actual remaining bytes in the input and throws before any allocation occurs.

Detection Methods for CVE-2026-107388

Indicators of Compromise

  • Repeated spikes in Node.js resident set size (RSS) correlated with media upload or ingest activity
  • Process crashes with JavaScript heap out of memory or FATAL ERROR: Reached heap limit in application logs
  • Inbound files with an ID3 header but a total file size dramatically smaller than the declared tag size
  • Successful metadata parses that return empty or default tag objects despite large declared tag sizes

Detection Strategies

  • Inventory Node.js services using npm ls music-metadata or SBOM queries to find versions below 11.16.0
  • Add pre-parse validation that rejects uploads where the declared ID3v2 tag size exceeds the file size
  • Instrument the parsing path with memory high-water-mark metrics to flag outlier allocations per request

Monitoring Recommendations

  • Monitor container and pod memory limits for OOMKilled events on services that handle user-supplied media
  • Alert on sustained increases in heap allocation rate from media-processing worker pools
  • Log the size, MIME type, and parse duration of every ingested media file for anomaly detection

How to Mitigate CVE-2026-107388

Immediate Actions Required

  • Upgrade music-metadata to version 11.16.0 or later across all applications and transitive dependencies
  • Enforce an upload size cap and reject files below a reasonable minimum size for the declared media format
  • Isolate media parsing in a worker process or sandbox with a hard memory limit so a single malicious file cannot kill the main service

Patch Information

The fix is included in music-metadata v11.16.0 via pull request #2743 and commit b033db6. Full details are published in GitHub Security Advisory GHSA-jjpr-9cvf-cq55.

Workarounds

  • Validate uploaded media file size before invoking the parser and reject files that are implausibly small for their declared format
  • Run the parser inside a child process started with --max-old-space-size set to a low value to contain allocation abuse
  • Apply a rate limit on media upload endpoints to blunt repeated allocation attempts from a single source
bash
# Upgrade music-metadata to the patched release
npm install music-metadata@^11.16.0

# Verify no vulnerable versions remain in the dependency tree
npm ls music-metadata

# Audit the project for related advisories
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.