Skip to content
Heist/ feed
Back to feed
MediumFix available

music-metadata: Uncontrolled memory allocation in APEv2 parser

Type: advisorySources: OSV

## 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: ```ts size: Token.UINT32_LE.get(buf, off) ``` It is later used directly for allocation when parsing binary tag items: ```ts 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: ```bash npm install --ignore-scripts npm run compile-sr

Products
music-metadata
Affected versions
Not specified
Fixed versions
11.16.0
CVEs
CVE-2026-107387
Confirmed fixed CVEs
Not specified
Updated in this feed
28 Oct 2026, 10:04 UTC · Revision 1

Source evidence

music-metadata: Uncontrolled memory allocation in APEv2 parser

core-osv · Original source

Published 8 Oct 2026, 19:43 UTC

## 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: ```ts size: Token.UINT32_LE.get(buf, off) ``` It is later used directly for allocation when parsing binary tag items: ```ts 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: ```bash npm install --ignore-scripts npm run compile-sr

osv:GHSA-53v6-4h7p-p4gj

music-metadata

Fixed versions: 11.16.0

Complete source record
{
  "id": "fb6beec9696a82e7339ea8f66cf67398656ce543978ec2e4d19fedae0819585e",
  "url": "https://osv.dev/vulnerability/GHSA-53v6-4h7p-p4gj",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "music-metadata: Uncontrolled memory allocation in APEv2 parser",
    "summary": "## 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: ```ts size: Token.UINT32_LE.get(buf, off) ``` It is later used directly for allocation when parsing binary tag items: ```ts 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: ```bash npm install --ignore-scripts npm run compile-sr",
    "evidence": "osv:GHSA-53v6-4h7p-p4gj",
    "products": [
      {
        "name": {
          "value": "music-metadata",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "11.16.0",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "GHSA-53v6-4h7p-p4gj",
      "aliases": [
        "CVE-2026-107387",
        "GHSA-53v6-4h7p-p4gj"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "11.16.0"
                }
              ]
            }
          ],
          "package": {
            "name": "music-metadata",
            "purl": "pkg:npm/music-metadata",
            "ecosystem": "npm"
          },
          "database_specific": {
            "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-53v6-4h7p-p4gj/GHSA-53v6-4h7p-p4gj.json",
            "last_known_affected_version_range": "<= 11.12.3"
          }
        }
      ],
      "modified": "2026-10-08T20:00:06.157159672Z",
      "provider": "osv",
      "references": [
        "https://github.com/Borewit/music-metadata/security/advisories/GHSA-53v6-4h7p-p4gj",
        "https://github.com/Borewit/music-metadata/pull/2744",
        "https://github.com/Borewit/music-metadata/commit/b3bf52cb6021b046f33ba47583e19ab8f10dd235",
        "https://github.com/Borewit/music-metadata",
        "https://github.com/Borewit/music-metadata/releases/tag/v11.16.0"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-789"
        ],
        "severity": "MODERATE",
        "github_reviewed": true,
        "nvd_published_at": null,
        "github_reviewed_at": "2026-10-08T19:43:22Z"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-107387",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 104575,
  "published_at": "2026-10-08T19:43:22+00:00"
}