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

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

CVE-2025-60468 is a use-after-free vulnerability in GPAC MP4Box that allows local attackers to cause denial of service through crafted media files. This article covers the technical details, affected versions, and mitigation.

Published:

CVE-2025-60468 Overview

CVE-2025-60468 is a heap use-after-free vulnerability in GPAC Multimedia Open Source Project's MP4Box utility, version 2.5-DEV-rev1593-gfe88c3545-master. The flaw resides in the gf_filter_pid_inst_swap_delete_task() function within filter_core/filter_pid.c (lines 574-580). The function improperly accesses freed objects during PID instance swap and delete cleanup operations. A local authenticated user processing a crafted MPEG-2 TS or MP4 file with MP4Box can trigger the bug during filter teardown, causing a crash. The vulnerability is classified under [CWE-122] Heap-based Buffer Overflow.

Critical Impact

Local authenticated attackers can crash MP4Box by supplying malformed MPEG-2 TS or MP4 input, triggering a heap use-after-free during PID instance cleanup. Further exploitation beyond denial of service may be possible.

Affected Products

  • GPAC Multimedia Open Source Project
  • GPAC Project / MP4Box version 2.5-DEV-rev1593-gfe88c3545-master
  • GPAC filter core component (filter_core/filter_pid.c)

Discovery Timeline

  • 2026-06-24 - CVE-2025-60468 published to NVD
  • 2026-06-25 - Last updated in NVD database

Technical Details for CVE-2025-60468

Vulnerability Analysis

The defect lives in GPAC's filter pipeline, which manages PID (Packet Identifier) instances connecting source and destination filters. When a PID instance undergoes a swap or delete operation, gf_filter_pid_inst_swap_delete_task() performs cleanup on instance objects. The function dereferences these objects after they have been freed, producing a classic heap use-after-free condition. Triggering the bug requires processing a specially crafted MPEG-2 Transport Stream or MP4 file through MP4Box, which forces the filter graph into a reconfiguration path that reaches the vulnerable teardown logic.

Root Cause

The root cause is missing state tracking during PID instance reconfiguration in discard mode. When a relink operation is already pending on a destination PID instance, the original code re-entered the relink path and freed objects that were still referenced by an in-flight task. The patch in commit aed9c94e92e8ba362ddb29c767c519478f46f195 adds a swap_source pointer on the source PID instance and changes the discard_inputs check to use the explicit GF_PIDI_DISCARD_ON enum, ensuring the swap state is preserved across the connect task. A companion patch in commit 976dacf65cb6986a4e4f350fb8d3ed0a17dc3a77 gates the relink call behind a !pidinst->detach_pending check, preventing a second relink from freeing objects the pending one still owns.

Attack Vector

The attack vector is local. An authenticated user must invoke MP4Box against a malformed media file. The CVSS vector indicates no impact to confidentiality or integrity, but a high impact on availability through a process crash. Exploitation requires no user interaction beyond running the tool against attacker-supplied input, which is a realistic scenario for media-processing pipelines that accept untrusted files.

c
// Patch: src/filter_core/filter_pid.c — guard relink when detach is pending
            GF_LOG(GF_LOG_ERROR, GF_LOG_FILTER, ("Failed to reconfigure PID %s:%s in filter %s: %s\n", pid->filter->name, pid->name, filter->name, gf_error_to_string(e) ));

            filter->session->last_connect_error = e;
-       } else {
+       }
+       //do not relink dst if one relink already pending
+       else if (!pidinst->detach_pending) {
            GF_LOG(GF_LOG_INFO, GF_LOG_FILTER, ("Failed to reconfigure PID %s:%s in filter %s: %s, reloading filter graph\n", pid->filter->name, pid->name, filter->name, gf_error_to_string(e) ));
            gf_list_add(pid->filter->blacklisted, (void *) filter->freg);
            gf_filter_relink_dst(pidinst, e);
+       } else {
+           e = GF_OK;
        }
// Source: https://github.com/gpac/gpac/commit/976dacf65cb6986a4e4f350fb8d3ed0a17dc3a77
c
// Patch: src/filter_core/filter.c — track new filter for swap via swap_source
            new_f->swap_pidinst_dst = dst_pidi;
            //keep track of the pidinst being detached from the source filter
            new_f->swap_pidinst_src = src_pidi;
+           //remember the new filter for the swap - cf gf_filter_pid_connect_task
+           src_pidi->swap_source = new_f;
            new_f->swap_needs_init = GF_TRUE;
            new_f->swap_pending = GF_TRUE;
// Source: https://github.com/gpac/gpac/commit/aed9c94e92e8ba362ddb29c767c519478f46f195

Detection Methods for CVE-2025-60468

Indicators of Compromise

  • Unexpected crashes of the MP4Box process during ingest or transcoding of MPEG-2 TS or MP4 files.
  • Core dumps or AddressSanitizer reports referencing gf_filter_pid_inst_swap_delete_task in filter_core/filter_pid.c.
  • Presence of unusually small or malformed MPEG-2 TS/MP4 samples in directories monitored by automated media workflows.

Detection Strategies

  • Inspect installed GPAC builds for the affected version string 2.5-DEV-rev1593-gfe88c3545-master using MP4Box -version.
  • Enable AddressSanitizer in non-production GPAC builds to catch use-after-free conditions in the filter teardown path.
  • Correlate process termination events for MP4Box with the originating user and input file path through host telemetry.

Monitoring Recommendations

  • Monitor file-processing services that invoke MP4Box for abnormal exit codes and segmentation faults.
  • Audit user accounts authorized to run MP4Box, since exploitation requires local authenticated access.
  • Log and retain hashes of media samples processed by MP4Box to support post-incident triage of crashing inputs.

How to Mitigate CVE-2025-60468

Immediate Actions Required

  • Rebuild GPAC from a commit at or after 976dacf65cb6986a4e4f350fb8d3ed0a17dc3a77 and aed9c94e92e8ba362ddb29c767c519478f46f195 on the master branch.
  • Restrict MP4Box execution to trusted users and validate the provenance of all input media files.
  • Sandbox automated media-processing workers so that an MP4Box crash cannot disrupt adjacent services.

Patch Information

The upstream project shipped two related fixes. Commit 976dacf adds a !pidinst->detach_pending guard in filter_core/filter_pid.c to prevent a duplicate relink during reconfiguration. Commit aed9c94 introduces a swap_source pointer in filter.c and filter_pck.c to preserve swap state across the connect task. The upstream tracking issue is GPAC GitHub Issue #3290, and a proof-of-concept sample is published in the sigdevel PoC repository.

Workarounds

  • Avoid running MP4Box against untrusted MPEG-2 TS or MP4 inputs until the patched build is deployed.
  • Run MP4Box under a low-privilege service account inside a container or seccomp profile to contain crashes.
  • Implement pre-processing validation that rejects malformed media before it reaches the GPAC filter graph.
bash
# Build patched GPAC from source
git clone https://github.com/gpac/gpac.git
cd gpac
git checkout master
git log --oneline | grep -E "976dacf|aed9c94"
./configure
make -j$(nproc)
sudo make install
MP4Box -version

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

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

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.