CVE-2024-7055

6.3 MEDIUM

📋 TL;DR

A critical heap-based buffer overflow vulnerability exists in FFmpeg's PNM image decoder (pnm_decode_frame function). Attackers can exploit this remotely by sending specially crafted PNM files, potentially leading to arbitrary code execution. This affects all systems running FFmpeg versions up to 7.0.1 that process untrusted PNM images.

💻 Affected Systems

Products:
  • FFmpeg
Versions: Up to and including version 7.0.1
Operating Systems: All platforms running FFmpeg (Linux, Windows, macOS, etc.)
Default Config Vulnerable: ⚠️ Yes
Notes: Any application or service using FFmpeg to decode PNM images is vulnerable. This includes media processing pipelines, web applications, and video editing software.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with the privileges of the FFmpeg process, potentially leading to complete system compromise.

🟠

Likely Case

Application crash (denial of service) or limited memory corruption leading to unstable behavior.

🟢

If Mitigated

No impact if proper input validation and memory protections are in place, though exploitation risk remains.

🌐 Internet-Facing: HIGH - Remote exploitation is possible without authentication.
🏢 Internal Only: MEDIUM - Requires processing malicious PNM files, which could occur through internal workflows.

🎯 Exploit Status

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

Proof-of-concept exploit code is publicly available on GitHub, making exploitation straightforward for attackers.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 7.0.2

Vendor Advisory: https://ffmpeg.org/

Restart Required: Yes

Instructions:

1. Download FFmpeg 7.0.2 or later from https://ffmpeg.org/download.html. 2. Compile and install the new version. 3. Restart any services or applications using FFmpeg.

🔧 Temporary Workarounds

Disable PNM decoder

all

Remove or disable the PNM decoder in FFmpeg to prevent exploitation.

Recompile FFmpeg with --disable-decoder=pnm

Input validation

all

Implement strict input validation to reject suspicious PNM files before processing.

🧯 If You Can't Patch

  • Implement network segmentation to isolate FFmpeg instances from untrusted networks.
  • Use application allowlisting to restrict which files FFmpeg can process.

🔍 How to Verify

Check if Vulnerable:

Check FFmpeg version: if it's 7.0.1 or earlier, it's vulnerable. Test with the public PoC to confirm exploitability.

Check Version:

ffmpeg -version | grep 'version'

Verify Fix Applied:

Verify FFmpeg version is 7.0.2 or later. Test with the PoC to ensure it no longer crashes or exhibits abnormal behavior.

📡 Detection & Monitoring

Log Indicators:

  • Segmentation fault or crash logs from FFmpeg processes
  • Unexpected memory access errors in system logs

Network Indicators:

  • Inbound connections delivering PNM files to FFmpeg services
  • Unusual outbound connections from FFmpeg processes post-exploitation

SIEM Query:

source="*ffmpeg*" AND (event="segmentation fault" OR event="buffer overflow")

🔗 References

📤 Share & Export