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-107391 Overview
CVE-2026-107391 is a denial-of-service vulnerability in music-metadata, a popular Node.js metadata parser for audio and video files. A regression introduced after version 11.14.0 in the MP4 stsd sample-description parser allows a crafted MP4 file to block the Node.js event loop and exhaust process memory. The vulnerability stems from improper validation of sample-entry size values, enabling an attacker-controlled zero-size entry combined with a large entry_count to trigger an unbounded synchronous loop. The flaw was present on the public master branch but never shipped in an npm release prior to 11.14.0. Version 11.16.0 contains the fix.
Critical Impact
A single crafted MP4-family file can stall the Node.js event loop and grow memory until the process is terminated, resulting in service-wide denial of service.
Affected Products
- borewit/music-metadata development revisions introduced after 11.14.0
- Applications bundling the vulnerable master-branch build of music-metadata
- Node.js services that parse untrusted MP4-family inputs with the affected code
Discovery Timeline
- 2026-10-08 - CVE-2026-107391 published to NVD
- 2026-10-13 - Last updated in NVD database
Technical Details for CVE-2026-107391
Vulnerability Analysis
The vulnerability resides in the StsdAtom.get parser located in lib/mp4/AtomToken.ts. MP4 containers include a sample description box (stsd) that lists one or more SampleEntry structures. Each entry begins with a 32-bit size field. The pre-patch parser trusted the file-supplied numberOfEntries value and iterated that many times without validating per-entry size.
When a crafted file declares a very large entry_count and sets a SampleEntry size of zero, the read cursor (off) never advances. The synchronous for loop then runs up to numberOfEntries iterations, allocating a SampleDescriptionTable on each pass. This blocks the Node.js event loop and grows heap memory until the process is terminated or the operating system kills it [CWE-400: Uncontrolled Resource Consumption].
Root Cause
The parser lacked bounds checks relating the sample-entry size to the remaining stsd payload. Without a minimum-size enforcement, a zero-sized entry caused the cursor to stall while the loop continued, and without an upper-bound check tied to available bytes, the loop could not terminate early.
Attack Vector
An attacker supplies a malicious MP4, M4A, or related ISO base media file to any Node.js service that parses metadata with the vulnerable library. The attack requires no authentication and no user interaction beyond submitting the file to the parsing endpoint.
public get(buf: Uint8Array, off: number): IAtomStsd {
-
+ 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); // Sample description size
+ // A SampleEntry needs its size, format, reserved bytes and data reference index.
+ // Requiring it to fit also bounds the loop by the available payload, not entry_count.
+ 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));
Source: GitHub Commit 90a7d52. The patch introduces an end boundary, requires a minimum SampleEntry size of 16 bytes, and ensures each entry fits within the remaining stsd payload.
Detection Methods for CVE-2026-107391
Indicators of Compromise
- Node.js worker processes consuming sustained 100% CPU on a single core immediately after accepting an MP4 upload
- Rapid heap growth in services calling parseFile, parseBuffer, or parseStream from music-metadata
- Process restarts or OOM-killer entries in system logs correlated with media parsing requests
Detection Strategies
- Inventory package-lock.json and yarn.lock files for music-metadata versions pulled directly from the GitHub master branch between 11.14.0 and 11.16.0
- Instrument parsing endpoints with per-request CPU time and memory ceilings to surface runaway invocations
- Enable Node.js --trace-warnings and event-loop lag metrics to identify blocking parse operations
Monitoring Recommendations
- Alert on repeated process restarts of services that handle user-supplied media files
- Log the size, MIME type, and parse duration for every uploaded media file to establish a baseline
- Monitor container memory limits and OOM events in orchestration platforms such as Kubernetes
How to Mitigate CVE-2026-107391
Immediate Actions Required
- Upgrade music-metadata to version 11.16.0 or later across all projects and container images
- Audit any installation that pins the library to a Git commit rather than a released npm version
- Restrict file upload size and MIME types for endpoints that invoke the parser
Patch Information
The fix is delivered in music-metadata v11.16.0. The underlying change is tracked in Pull Request #2734 and documented in GitHub Security Advisory GHSA-f94x-6692-553q. The patch validates the stsd header length, enforces a 16-byte minimum per SampleEntry, and bounds the loop by the available payload rather than the attacker-controlled entry_count.
Workarounds
- Pin music-metadata to the last unaffected npm release (11.14.0) until upgrade to 11.16.0 is possible
- Run media parsing in isolated worker threads or child processes with hard CPU and memory limits
- Validate MP4 container structure with a lightweight pre-parser before invoking music-metadata
# Upgrade to the fixed version
npm install music-metadata@^11.16.0
# Verify the installed version
npm ls music-metadata
# Audit for the vulnerable advisory
npm audit
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

