Skip to main content
Vulnerability Database/CVE-2024-58397

CVE-2024-58397: MP4v2 Information Disclosure Vulnerability

CVE-2024-58397 is an information disclosure flaw in MP4v2 library that enables heap-based out-of-bounds reads through malicious MP4 files. This article covers technical details, affected versions, impact, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-58397 Overview

CVE-2024-58397 is a heap-based out-of-bounds read [CWE-125] in the MP4v2 library through version 2.1.3. The flaw resides in the MP4File::GetChapters() function and triggers when the library parses crafted QuickTime chapter samples. An attacker supplies an MP4 file whose chapter sample is shorter than its declared title length. The parser then reads past the end of the heap allocation while constructing chapter titles. Applications such as mp4chaps either crash or expose adjacent heap memory contents inside the returned chapter titles.

Critical Impact

Processing an untrusted MP4 file with a vulnerable MP4v2 build can leak adjacent heap memory and crash the host application.

Affected Products

  • MP4v2 library versions up to and including 2.1.3
  • Command-line tools built on MP4v2, including mp4chaps
  • Downstream applications and media pipelines that link MP4v2 for QuickTime chapter parsing

Discovery Timeline

  • 2026-10-15 - CVE-2024-58397 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2024-58397

Vulnerability Analysis

The vulnerability lives in MP4File::GetChapters() within src/mp4file.cpp. The function iterates over QuickTime chapter samples and extracts a chapter title whose length is derived from a 16-bit field embedded in the sample. The implementation trusts this declared title length without validating it against the actual sample size returned by the demuxer.

When the declared length exceeds the real sample length, the copy routine reads bytes beyond the allocated heap buffer. Those out-of-bounds bytes are then written into the chapter title structure returned to the caller. The result is either a process crash from touching unmapped memory or an information disclosure where adjacent heap data appears inside chapter title strings.

Exploitation requires local file processing and user interaction, since the victim must open or scan a crafted MP4 file. The impact is bounded to the process address space of the application using MP4v2.

Root Cause

The root cause is missing bounds validation between the declared chapter title length and the actual chapter sample size. The parser assumes title_length <= sample_size - header_bytes, but this invariant is attacker-controlled. See the vulnerable range in mp4file.cpp lines 2618-2627 and the HackMD CVE-2024-58397 Analysis.

Attack Vector

The attacker crafts an MP4 container whose QuickTime chapter track references a sample shorter than the title length encoded inside it. The victim runs an MP4v2-based tool such as mp4chaps against the file, or a server-side pipeline ingests it for chapter extraction. The out-of-bounds read then executes during chapter enumeration.

// Code example not reproduced here. Refer to the upstream source for the
// vulnerable GetChapters() implementation:
// https://github.com/enzo1982/mp4v2/blob/f4c2f1b87446100728472d80fd1161d2f8e830b2/src/mp4file.cpp#L2618-L2627

Detection Methods for CVE-2024-58397

Indicators of Compromise

  • Crashes or segmentation faults in processes linking MP4v2, especially mp4chaps and other command-line utilities, while handling user-supplied MP4 files.
  • MP4 files whose QuickTime chapter sample size is smaller than the declared 16-bit title length in the chapter atom.
  • Chapter title strings containing non-printable binary data or memory-like patterns after MP4v2 processing.

Detection Strategies

  • Scan software inventories and container images for MP4v2 builds at or below version 2.1.3.
  • Fuzz MP4v2-based tools with malformed chapter atoms and capture AddressSanitizer or Valgrind reports flagging heap-buffer-overflow reads in MP4File::GetChapters().
  • Monitor process telemetry for repeated abnormal termination of media parsers after file ingestion events.

Monitoring Recommendations

  • Log and alert on crashes of MP4v2 consumers in ingestion pipelines, batch transcoders, and desktop media utilities.
  • Correlate inbound untrusted MP4 uploads with downstream parser faults to surface targeted probing.
  • Track MP4v2 library versions across endpoints and servers through software bill of materials (SBOM) tooling.

How to Mitigate CVE-2024-58397

Immediate Actions Required

  • Identify every application and container image that statically or dynamically links MP4v2 up to 2.1.3.
  • Restrict MP4v2-based tooling to trusted inputs until a fixed build is deployed.
  • Treat crashes in mp4chaps and related utilities as potential exploitation signals and preserve the triggering file for analysis.

Patch Information

At the time of publication, no fixed upstream release is referenced in the advisory. Track the GitHub mp4v2 Repository and GitHub Issue #53 Discussion for patch availability. Review the VulnCheck Security Advisory for status updates and the HackMD Out-of-Bounds Read Analysis for technical remediation guidance.

Workarounds

  • Avoid invoking MP4v2 utilities such as mp4chaps on MP4 files received from untrusted sources.
  • Sandbox media parsers using seccomp, AppArmor, or container isolation to contain out-of-bounds reads and crashes.
  • Pre-validate MP4 containers with an independent parser that enforces chapter sample size consistency before handing files to MP4v2.
  • Disable chapter parsing in downstream workflows when it is not required for the media processing use case.
bash
# Configuration example not provided; refer to upstream guidance in the
# vendor advisory and GitHub issue tracker for sanctioned mitigations.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.