CVE-2021-40570
📋 TL;DR
A double-free vulnerability in Gpac's MP4Box allows attackers to cause denial of service or potentially execute arbitrary code. This affects systems running vulnerable versions of Gpac that process malicious MP4 files. The vulnerability can lead to application crashes or full system compromise.
💻 Affected Systems
- Gpac
- MP4Box
📦 What is this software?
Gpac by Gpac
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to full system compromise, privilege escalation, and persistent access to affected systems.
Likely Case
Denial of service through application crashes when processing malicious MP4 files.
If Mitigated
Application crash without code execution if memory protections are enabled.
🎯 Exploit Status
Exploitation requires crafting a malicious MP4 file that triggers the double-free condition. Public GitHub issues demonstrate the vulnerability.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Fixed in commit 04dbf08bff4d61948bab80c3f9096ecc60c7f302 and later versions
Vendor Advisory: https://github.com/gpac/gpac/commit/04dbf08bff4d61948bab80c3f9096ecc60c7f302
Restart Required: Yes
Instructions:
1. Update Gpac to version containing commit 04dbf08bff4d61948bab80c3f9096ecc60c7f302 or later. 2. Rebuild from source if using custom builds. 3. Restart any services using MP4Box.
🔧 Temporary Workarounds
Disable MP4Box processing
linuxTemporarily disable or restrict MP4Box usage until patched
chmod -x /usr/bin/MP4Box
mv /usr/bin/MP4Box /usr/bin/MP4Box.disabled
Input validation
allImplement strict validation of MP4 files before processing
🧯 If You Can't Patch
- Implement strict access controls to limit who can submit MP4 files for processing
- Deploy memory protection mechanisms like ASLR and DEP to reduce exploit success
🔍 How to Verify
Check if Vulnerable:
Check Gpac version: gpac -version or examine installed package version. Versions before commit 04dbf08bff4d61948bab80c3f9096ecc60c7f302 are vulnerable.
Check Version:
gpac -version 2>/dev/null | head -1 || dpkg -l | grep gpac || rpm -qa | grep gpac
Verify Fix Applied:
Verify Gpac version contains commit 04dbf08bff4d61948bab80c3f9096ecc60c7f302 or check package manager for updated version.
📡 Detection & Monitoring
Log Indicators:
- MP4Box crash logs
- segmentation fault errors in system logs
- unexpected process termination
Network Indicators:
- Unusual MP4 file uploads to processing systems
- Multiple failed MP4 processing attempts
SIEM Query:
process_name="MP4Box" AND (event_type="crash" OR exit_code="139" OR exit_code="-11")
🔗 References
- https://github.com/gpac/gpac/commit/04dbf08bff4d61948bab80c3f9096ecc60c7f302
- https://github.com/gpac/gpac/issues/1899
- https://www.debian.org/security/2023/dsa-5411
- https://github.com/gpac/gpac/commit/04dbf08bff4d61948bab80c3f9096ecc60c7f302
- https://github.com/gpac/gpac/issues/1899
- https://www.debian.org/security/2023/dsa-5411