High

music-metadata has an infinite loop vulnerability in ASF parser

  • Disclosed: 17.03.2026
  • Updated: 11.10.2026 10:22

Summary

music-metadata's ASF parser (parseExtensionObject() in lib/asf/AsfParser.ts:112-158) enters an infinite loop when a sub-object inside the ASF Header Extension Object has objectSize = 0.

Root Cause

When objectSize is 0:

  1. remaining = 0 - 24 = -24
  2. tokenizer.ignore(-24) moves the read position backward by 24 bytes
  3. extensionSize -= 0 (loop counter never decreases)
  4. while (extensionSize > 0) never exits
  5. The same 24-byte header is re-read infinitely

This is the same pattern as CVE-2026-31808 (GHSA-5v7r-6r5c-r473) in file-type — strtok3's AbstractTokenizer.ignore() accepts negative values without validation.

Affected Methods

  • parseFile() — HANGS (FileTokenizer inherits vulnerable ignore())
  • parseBuffer() — HANGS (BufferTokenizer inherits vulnerable ignore())
  • parseStream() — NOT affected (ReadStreamTokenizer has own ignore() that throws RangeError)

Impact

A 100-byte crafted .asf file permanently hangs any application using parseFile() or parseBuffer(). music-metadata has 2.2M weekly npm downloads.

Suggested Fix

Validate objectSize >= minimumHeaderSize before calculating the payload. Or fix strtok3's AbstractTokenizer.ignore() to reject negative values.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package music-metadata < 11.12.3 11.12.3

References

CVSS score 7.5/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness (CWE)
CWE-835
Platform
npm
Package
music-metadata
Disclosed
17.03.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-v6c2-xwv6-8xf7 - CC BY 4.0

Vulnerability history: music-metadata

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
6
First → latest
03.2026 10.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 1
  • Medium 5

Disclosures per year

  1. 2026: 6
  1. Medium · 6.2 CVE-2026-107387 < 11.16.0 11.16.0
  2. music-metadata has an infinite loop vulnerability in ASF parser this entry
    High · 7.5 CVE-2026-32256 < 11.12.3 11.12.3

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.