Skip to main content
Vulnerability Database/CVE-2025-60478

CVE-2025-60478: GPAC MP4Box Use-After-Free Vulnerability

CVE-2025-60478 is a use-after-free vulnerability in GPAC MP4Box that enables attackers to trigger denial of service through malicious MPEG-2 files. This article covers technical details, affected versions, 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-2025-60478 Overview

CVE-2025-60478 is a use-after-free vulnerability in the gf_filter_packet_destroy function located in /filter_core/filter_pck.c of the GPAC multimedia framework. The flaw affects GPAC Project MP4Box releases prior to version 2.5. An attacker can trigger the condition by supplying a crafted MPEG-2 file to MP4Box, causing the application to access freed memory and crash. The result is a denial-of-service (DoS) against processes or services that parse untrusted media files with the vulnerable component.

Critical Impact

A crafted MPEG-2 file can trigger a use-after-free in MP4Box, causing a denial-of-service in any application or automated pipeline that parses untrusted media with GPAC prior to 2.5.

Affected Products

  • GPAC Project MP4Box versions before 2.5
  • GPAC framework builds that embed the vulnerable filter_core/filter_pck.c logic
  • Media processing pipelines and services that invoke GPAC on untrusted MPEG-2 input

Discovery Timeline

  • 2026-10-21 - CVE-2025-60478 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2025-60478

Vulnerability Analysis

The vulnerability is a use-after-free [CWE-416] in GPAC's filter packet lifecycle. GPAC's filter core manages packet references across chained filters that process media samples. When gf_filter_packet_destroy executes without accounting for shared packets still held by downstream consumers, the packet memory can be released while another code path still references it. Subsequent access to the dangling pointer corrupts filter state and crashes the process.

The condition is reachable through normal MP4Box invocation against a specifically shaped MPEG-2 input. Because MP4Box is widely used as a batch tool and library backend, the fault propagates to any surrounding automation that treats input files as untrusted.

Root Cause

The filter destruction gate in src/filter_core/filter.c only checked out_pid_connection_pending, detach_pid_tasks_pending, and nb_ref_packets before allowing teardown. It did not consider nb_shared_packets_out, the counter tracking packets still shared with downstream filters. As a result, a filter could be destroyed while packets it owned remained in use elsewhere, leaving references pointing to freed memory.

Attack Vector

Exploitation requires the victim to process an attacker-supplied MPEG-2 file with a vulnerable MP4Box build. No authentication is required for local invocation, and server-side media conversion services that accept uploads are directly exposed. The documented outcome is denial-of-service through process termination; memory corruption primitives beyond DoS have not been demonstrated in the public advisory.

c
 	u32 count = gf_fq_count(f->tasks);
 
 	//do not destroy filters if tasks for this filter are pending or some ref packets are still present
-	if (f->out_pid_connection_pending || f->detach_pid_tasks_pending || f->nb_ref_packets) {
+	if (f->out_pid_connection_pending || f->detach_pid_tasks_pending || f->nb_ref_packets || f->nb_shared_packets_out) {
 		task->requeue_request = GF_TRUE;
 		return;
 	}

Source: GPAC commit c592a14. The patch adds f->nb_shared_packets_out to the destruction guard so filters with outstanding shared packets are requeued instead of torn down.

Detection Methods for CVE-2025-60478

Indicators of Compromise

  • Unexpected MP4Box or GPAC-linked process crashes with SIGSEGV or SIGABRT while parsing MPEG-2 files
  • Core dumps referencing gf_filter_packet_destroy or filter_pck.c frames
  • Media conversion workers terminating repeatedly on specific uploaded assets

Detection Strategies

  • Inventory hosts running GPAC or MP4Box and flag any build earlier than version 2.5
  • Correlate crash telemetry from media processing services with recent file uploads of MPEG-2 content
  • Monitor sandboxed media parsers for abnormal exit codes and repeated restarts tied to the same input hash

Monitoring Recommendations

  • Enable crash reporting and core dump collection on media conversion hosts to capture the faulting stack
  • Forward process exit and segfault events to the SIEM and alert on repeated MP4Box terminations within short windows
  • Track file hashes that produce reproducible crashes and share indicators with upstream intake services

How to Mitigate CVE-2025-60478

Immediate Actions Required

  • Upgrade GPAC and MP4Box to version 2.5 or later across all build and runtime environments
  • Rebuild any downstream applications that statically link GPAC against a patched source tree
  • Restrict MP4Box execution on untrusted input to sandboxed, resource-limited workers until patching completes

Patch Information

The fix is committed upstream in GPAC commit c592a14, which resolves GPAC issue #3300. The change extends the filter destruction guard to include nb_shared_packets_out, preventing teardown while shared packets remain outstanding. A reproduction case is documented in the sigdevel PoC README and referenced in the Infosec Exchange post.

Workarounds

  • Reject or quarantine MPEG-2 inputs from untrusted sources until the upgrade is deployed
  • Run MP4Box under a process supervisor with automatic restart and strict CPU, memory, and filesystem limits
  • Isolate media parsing in short-lived containers so a crash does not affect other tenants or pipeline stages
bash
# Verify installed MP4Box version and upgrade from source
MP4Box -version
git clone https://github.com/gpac/gpac.git
cd gpac
git checkout v2.5
./configure && make -j$(nproc)
sudo make install

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.