The vulnerability in music-metadata (CVE-2026-107389) stems from the EBML parser's trust in attacker-controlled element lengths without proper validation. The EbmlIterator.readElement function reads the len field from the EBML stream, which is a variable-length integer. This len value, representing the size of the subsequent data, was not checked for sanity (e.g., against the parent container's bounds, the total file size, or maximum safe integer limits). Consequently, when this unvalidated len was passed to EbmlIterator.readBuffer and EbmlIterator.readString, these functions would directly use it to allocate memory. For instance, readBuffer would create a Uint8Array of the declared size, and readString would use it to create a StringType token. An attacker could craft a small Matroska/WebM file with an element declaring an extremely large length (e.g., 32 GiB). When parsed, this would trigger an attempt to allocate a massive amount of memory, leading to an out-of-memory condition and a denial of service. In some cases, this could even cause an uncatchable V8 fatal abort. The fix involves adding explicit validation checks for element.len before any allocations occur and implementing incremental reading for large elements in streams where the total size is unknown, preventing single large allocations based on untrusted input.