CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-107391

CVE-2026-107391: Synchronous Infinite Loop and Memory Exhaustion in music-metadata MP4 Parser

Alon Barad
Alon Barad
Software Engineer

Oct 8, 2026·7 min read·18 visits

Executive Summary (TL;DR)

A regression in the MP4 stsd parser of music-metadata allows unauthenticated local or remote attackers to trigger a synchronous infinite loop and memory exhaustion via a crafted media file, blocking the Node.js event loop.

An input validation vulnerability exists in music-metadata versions prior to 11.16.0, where parsing a crafted MP4 file containing a sample-description (stsd) box with a zero-value size entry causes a synchronous infinite loop and memory exhaustion, resulting in complete Denial of Service.

Vulnerability Overview

The music-metadata package is a popular open-source audio and video metadata parser designed for Node.js and browser runtimes. It is widely incorporated into file-processing pipelines, content management systems, and media upload interfaces. Because it handles arbitrary binary streams from untrusted users, its parsing logic represents a critical surface area for security threats.

During development iterations on the master branch prior to release 11.16.0, a regression was introduced in the parser for MP4 stsd (sample description) boxes. The parsing logic is synchronous, which presents specific risks within the Node.js execution environment.

When music-metadata parses a maliciously structured MP4 file containing an entry with a declared size of zero, the internal file offset pointer fails to advance. The parsing loop continues indefinitely because its termination condition depends on an attacker-controlled entry counter. This infinite loop blocks the single-threaded Node.js event loop, preventing all concurrent execution and resulting in a denial of service.

Root Cause Analysis

The root cause of this vulnerability lies in lib/mp4/AtomToken.ts within the StsdAtom.get() method. A regression was introduced during modifications designed to align the offset progress calculation with the size fields of individual sample description entries. To compensate for the 4 bytes read during the size field extraction, the offset progress logic was updated from off += size to off += size - 4.

Under normal execution, the variable size represents the size of the current sample entry table, which must be at least 16 bytes. However, the input validation fails to verify that size is greater than or equal to the minimum required structure length before performing arithmetic on the pointer.

If the size field of an entry is explicitly set to 0 inside an attacker-controlled MP4 file, the math evaluates as follows:

  1. The offset pointer off is incremented by 4 bytes (Token.UINT32_BE.len) to account for reading the size field.
  2. The offset is updated by adding size - 4. Since size is 0, the program calculates 0 - 4 = -4.
  3. The net change to the offset pointer for that loop iteration is 4 + (-4) = 0.

Consequently, the pointer remains fixed on the exact same buffer location. In the next iteration of the loop, the parser reads the same zero value, calculates the same net zero progress, and remains stuck. Since the loop termination is bound by the attacker-specified numberOfEntries counter (which can be defined up to 4294967295), the execution hangs indefinitely.

Code Analysis and Comparison

The vulnerability is demonstrated in the execution logic within StsdAtom.get(). The following block represents the vulnerable execution path:

// Vulnerable loop structure in lib/mp4/AtomToken.ts
for (let n = 0; n < header.numberOfEntries; ++n) {
  const size = Token.UINT32_BE.get(buf, off); // Reads 0 from attacker-controlled buffer
  off += Token.UINT32_BE.len;                 // off increments by 4
  
  // Inserts a new table instance based on the non-advanced offset
  table.push(new SampleDescriptionTable(size - Token.UINT32_BE.len).get(buf, off));
  
  off += size - Token.UINT32_BE.len;          // off evaluates to: off + (0 - 4), net change is 0
}

Because the net progress of the pointer is zero, the loop iterates endlessly, reading the exact same index. In each iteration, table.push(...) is evaluated. This continuously appends elements to the internal array, causing unbounded heap memory growth until the system runs out of memory (OOM).

The fix implemented in version 11.16.0 addresses this by applying strict boundary validations. The size of each entry is now validated against the minimum physical length of an MP4 SampleEntry (16 bytes) and checked to ensure it does not exceed the remaining buffer length:

// Patched logic in lib/mp4/AtomToken.ts
const end = Math.min(off + this.len, buf.length);
if (end - off < stsdHeader.len) {
  throw new Mp4ContentError('Truncated stsd header');
}
 
const header = stsdHeader.get(buf, off);
off += stsdHeader.len;
const table: ISampleDescription[] = [];
 
for (let n = 0; n < header.numberOfEntries; ++n) {
  if (end - off < Token.UINT32_BE.len) {
    throw new Mp4ContentError('Truncated stsd sample entry');
  }
  const size = Token.UINT32_BE.get(buf, off);
  
  // Enforce absolute minimum entry size boundary of 16 bytes
  if (size < 16 || size > end - off) {
    throw new Mp4ContentError(`Invalid stsd sample entry size: ${size}`);
  }
  off += Token.UINT32_BE.len;
  table.push(new SampleDescriptionTable(size - Token.UINT32_BE.len).get(buf, off));
  off += size - Token.UINT32_BE.len;
}

By ensuring that size is at least 16, the loop is guaranteed to advance off by at least 12 bytes on each pass, preventing any freeze and constraining the absolute maximum execution iterations by the physical file size.

Exploitation Methodology

Exploitation of this vulnerability requires delivering a malformed MP4-family file (such as .mp4, .m4a, or .3gp) to an application that processes the file with an unpatched version of music-metadata.

The attack vector is local or remote, depending on where the host application processes files. In a common application scenario, a user uploads a media file to an API endpoint which then reads the metadata on the backend server. The attacker generates a minimal valid MP4 container consisting of basic headers and a corrupted stsd atom.

The structure of the exploit payload relies on key structures:

  • An ftyp box to bypass primitive format detection filters.
  • An stsd box that contains a numberOfEntries property set to a high limit, such as 0xFFFFFFFF.
  • A subsequent sample entry whose size field is declared as 0x00000000.

When the system receives the payload, the main Node.js event loop executes the parsing logic synchronously. Because Node.js is single-threaded, the entire process freezes. No concurrent network requests can be processed, and no microtasks or timers can execute. This blocks all application functionality for users sharing that process.

Impact Assessment

The overall security impact of this vulnerability is high, and it is classified as a severe Endpoint Denial of Service (T1499). While the attack does not allow privilege escalation or direct data leakage, its operational impact on Node.js-based services is complete.

Because of the single-threaded nature of Node.js, a synchronous infinite loop halts all event loop operations. Any other active requests are left unanswered, and the application becomes unresponsive. This allows a single unauthenticated HTTP request containing a small, 48-byte malicious file to completely disable a server instance.

Additionally, because each loop iteration instantiates and pushes a new SampleDescriptionTable object onto the local table array, the system dynamically consumes heap space. This results in rapid memory consumption, culminating in an Out Of Memory (OOM) error that terminates the Node.js process entirely, requiring a system restart.

Remediation and Mitigation

The primary recommendation is to update the music-metadata dependency to version 11.16.0 or higher, which integrates the correct boundary checks.

For environments where immediate upgrading is not possible, the following defensive practices should be adopted:

  1. Isolate Processing Pipelines: Run file metadata parsing tasks inside isolated Worker Threads (worker_threads module) or within sandbox subprocesses. This ensures that if a thread encounters an infinite loop or crashes from memory exhaustion, the main application remains responsive.

  2. Configure Process-Level Hard Limits: Employ process supervisors like PM2 or systemd to monitor CPU usage thresholds and memory footprints. Configure these managers to automatically recycle workers that exceed maximum expected runtimes or memory limits.

  3. Request Timeouts: Ensure that reverse proxies, load balancers, and gateway servers enforce strict timeouts on upload processing endpoints to prevent resources from being held indefinitely by locked processes.

Official Patches

BorewitCommit implementing input boundary validation within the MP4 sample description parser.

Technical Appendix

CVSS Score
6.2/ 10
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected Systems

Applications utilizing music-metadata versions < 11.16.0Node.js server-side media upload processorsClient-side browser applications parsing user-supplied MP4 files

Affected Versions Detail

Product
Affected Versions
Fixed Version
music-metadata
Borewit
< 11.16.011.16.0
AttributeDetail
CWE IDCWE-835 / CWE-400
Attack VectorLocal (AV:L)
CVSS v3.1 Score6.2 (Medium)
Exploit StatusPoC Validated
ImpactDenial of Service (DoS) and Memory Exhaustion (OOM)
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-835
Loop with Unreachable Exit Condition ('Infinite Loop')

The program contains an iteration loop with an exit condition that cannot be met, causing it to run indefinitely.

Known Exploits & Detection

GitHub Security AdvisoryExploit details and verification methods regarding the malformed 48-byte MP4 file.

Vulnerability Timeline

Vulnerability fix committed in version 11.16.0.
2026-09-20
GitHub Security Advisory published under ID GHSA-f94x-6692-553q.
2026-10-08
CVE-2026-107391 published to registry.
2026-10-08

References & Sources

  • [1]GitHub Security Advisory GHSA-f94x-6692-553q
  • [2]Fix Commit in music-metadata
  • [3]Pull Request #2734
  • [4]v11.16.0 Release Page
  • [5]CVE-2026-107391 on CVE.org

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•1 day ago•CVE-2026-58254
6.5

CVE-2026-58254: Authorization Bypass in NATS Server Message Tracing for Leaf Node Connections

NATS Server prior to versions 2.12.8 and 2.14.3 contains an incorrect authorization vulnerability (CWE-863) in its message tracing subsystem. When evaluating whether a connection is permitted to publish trace events to a destination subject specified in the Nats-Trace-Dest header, the server only checks standard client permissions and omits permission checks for leaf node connections. This allows a connected leaf node operator with restricted publishing privileges to emit internal trace events to unauthorized subjects and suppress standard message delivery using the Nats-Trace-Only header.

Alon Barad
Alon Barad
10 views•10 min read
•2 days ago•CVE-2026-63341
7.5

CVE-2026-63341: Unauthenticated Denial of Service via Unbounded Topic Depth in Aedes MQTT Broker

CVE-2026-63341 is a high-severity Denial of Service (DoS) vulnerability in the Aedes MQTT broker for Node.js affecting all versions prior to 1.1.1. The flaw stems from missing input validation on the hierarchical depth of incoming MQTT topic strings before they are passed to the underlying topic-matching engine, qlobber. Because qlobber enforces a hardcoded limit of 100 topic levels and throws a synchronous exception when this threshold is exceeded, an attacker can send a single MQTT packet containing 101 or more forward-slash-separated levels to trigger an uncaught exception that immediately terminates the Node.js broker process.

Alon Barad
Alon Barad
14 views•12 min read
•2 days ago•CVE-2026-61725
6.1

CVE-2026-61725: Path Traversal and Arbitrary File Overwrite in sevenz-rust2

CVE-2026-61725 is a path traversal vulnerability (CWE-22) in the sevenz-rust2 Cargo package prior to version 0.21.1. The vulnerability occurs because the decompression utility fails to validate or sanitize archive entry filenames before joining them with the destination directory path via std::path::Path::join. An attacker who supplies a crafted 7z archive containing parent directory traversal sequences or absolute paths can write or overwrite arbitrary files on the host filesystem with the privileges of the extracting process.

Alon Barad
Alon Barad
6 views•12 min read
•2 days ago•CVE-2026-77309
8.8

CVE-2026-77309: Unauthenticated Remote Code Execution in NASA-AMMOS AIT-GUI via Incomplete File Cleanup and Path Traversal

CVE-2026-77309 (GHSA-jrjx-9jjw-747m) is a high-severity unauthenticated remote code execution vulnerability affecting NASA-AMMOS AIT-GUI versions 1.0.0 through 2.5.0. The flaw results from chaining an incomplete file cleanup error in the telemetry query endpoint (/tlm/query) with a directory traversal flaw in the script execution endpoint (/script/run). An attacker on an adjacent network can stage arbitrary Python statements into a static file on disk and execute that file under the privileges of the AIT-GUI web server process.

Amit Schendel
Amit Schendel
13 views•10 min read
•2 days ago•CVE-2026-77332
2.3

CVE-2026-77332: Surfaced-Memory Envelope Injection and Stored Prompt Injection in memtomem-stm

A vulnerability classified under CWE-116 (Improper Encoding or Escaping of Output) exists in memtomem-stm versions 0.1.0 through 0.1.33. The software acts as a Model Context Protocol (MCP) short-term memory proxy gateway for AI agent architectures. When surfacing retrieved memories and scratchpad items into downstream Large Language Model (LLM) context envelopes, the SurfacingFormatter component fails to properly sanitize untrusted memory attributes. An attacker with the ability to plant untrusted content into the agent's long-term or working memory store can inject arbitrary structural delimiters, close the <surfaced-memories> XML boundary prematurely, visually obscure instructions using Unicode bidirectional overrides, and execute stored prompt injection attacks against downstream LLM agents.

Alon Barad
Alon Barad
17 views•10 min read
•2 days ago•CVE-2026-77331
2.0

CVE-2026-77331: Race Condition and Session State Corruption in memtomem-stm

CVE-2026-77331 (GHSA-72jh-722p-rqr3) is a concurrency and session-state synchronization vulnerability in memtomem-stm, a short-term memory proxy gateway for AI agents. In versions 0.1.2 prior to 0.1.34, concurrent Model Context Protocol (MCP) Remote Procedure Call (RPC) failures or mid-flight task cancellations can initiate duplicate reconnect loops and permit dirty or cancelled transport sessions to be reused. This deficiency results in session-state integrity loss and local service degradation.

Amit Schendel
Amit Schendel
8 views•9 min read