CVE-2026-107391: music-metadata: MP4 stsd sample-entry size==0 causes a synchronous infinite loop (DoS) — unreleased regression on master
StsdAtom.get() in lib/mp4/AtomToken.ts parses an MP4 stsd (sample description) box’s entry table by advancing a cursor with off += size - 4, where size is a 32-bit, attacker-controlled per-entry length read straight from the file. When size == 0, that advance is 0, so a file declaring a huge entry_count and a first entry size of 0 spins forever: same bytes read every iteration, no progress, no exit. Because StsdAtom.get runs synchronously inside strtok3’s tokenizer, this doesn’t just fail slowly — it blocks the Node.js event loop entirely for the whole process. A 48-byte file is enough to hang any service that parses user-uploaded audio/video metadata through parseBuffer, parseFile, parseStream, parseBlob, or parseWebStream.
This is currently unreleased — present on the master branch only, not in the latest npm release (11.14.0) or any earlier one. Reporting now, before it ships.
References
- github.com/Borewit/music-metadata/commit/90a7d52c69e921a0b019592d887acd97b1c8b8a5
- github.com/Borewit/music-metadata/pull/2734
- github.com/Borewit/music-metadata/releases/tag/v11.16.0
- github.com/Borewit/music-metadata/security/advisories/GHSA-f94x-6692-553q
- github.com/advisories/GHSA-f94x-6692-553q
- nvd.nist.gov/vuln/detail/CVE-2026-107391
Code Behaviors & Features
Detect and mitigate CVE-2026-107391 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →