CVE-2021-21840

8.8 HIGH

📋 TL;DR

This integer overflow vulnerability in GPAC's MPEG-4 decoder allows heap-based buffer overflow via specially crafted video files. Attackers can achieve remote code execution by tricking users into opening malicious videos. Affects applications using GPAC library for video processing.

💻 Affected Systems

Products:
  • GPAC Project on Advanced Content library
  • Applications using GPAC for MPEG-4 decoding
Versions: v1.0.1 and earlier
Operating Systems: Linux, Windows, macOS, Other Unix-like systems
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using GPAC library to process MPEG-4 files is vulnerable by default.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with the privileges of the application processing the video, potentially leading to full system compromise.

🟠

Likely Case

Application crash (denial of service) or arbitrary code execution depending on exploit sophistication.

🟢

If Mitigated

Application crash without code execution if exploit fails or mitigations like ASLR/DEP are effective.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploit requires user interaction to open malicious file but no authentication. Public proof-of-concept exists in Talos advisory.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v1.0.2 or later

Vendor Advisory: https://github.com/gpac/gpac/security/advisories/GHSA-5x5h-9wrq-9hcm

Restart Required: Yes

Instructions:

1. Update GPAC library to v1.0.2 or later. 2. Rebuild applications using GPAC. 3. Restart affected services/applications.

🔧 Temporary Workarounds

Disable MPEG-4 processing

all

Configure applications to disable MPEG-4 file processing if not required.

Application-specific configuration required

Input validation

all

Implement file type validation before processing with GPAC library.

Application-specific implementation required

🧯 If You Can't Patch

  • Implement strict file upload restrictions and validation for video files
  • Use application sandboxing/containerization to limit potential damage

🔍 How to Verify

Check if Vulnerable:

Check GPAC library version: gpac -version or examine linked library version in applications.

Check Version:

gpac -version 2>/dev/null | head -1

Verify Fix Applied:

Confirm GPAC version is 1.0.2 or higher and applications have been rebuilt with updated library.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes when processing video files
  • Memory access violation errors in application logs

Network Indicators:

  • Unusual video file downloads to systems running GPAC applications

SIEM Query:

source="application_logs" AND ("segmentation fault" OR "access violation" OR "heap corruption") AND process="*gpac*"

🔗 References

📤 Share & Export