CVE-2024-20505

4.0 MEDIUM

📋 TL;DR

An out-of-bounds read vulnerability in ClamAV's PDF parsing module allows remote attackers to cause denial of service by submitting crafted PDF files. This affects ClamAV scanning processes on devices running vulnerable versions, potentially disrupting antivirus scanning capabilities.

💻 Affected Systems

Products:
  • Clam AntiVirus (ClamAV)
Versions: 1.4.0, 1.3.2 and prior, all 1.2.x, 1.0.6 and prior, all 0.105.x, all 0.104.x, 0.103.11 and prior
Operating Systems: All operating systems running vulnerable ClamAV versions
Default Config Vulnerable: ⚠️ Yes
Notes: Affects any system where ClamAV scans PDF files, including mail gateways, file servers, and web applications using ClamAV integration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete disruption of ClamAV scanning services, potentially allowing malware to bypass detection while scanning is disabled.

🟠

Likely Case

Temporary termination of scanning processes requiring service restart, causing brief gaps in file scanning coverage.

🟢

If Mitigated

Minimal impact with proper network segmentation and file upload restrictions preventing malicious PDFs from reaching ClamAV.

🌐 Internet-Facing: MEDIUM - Exploitable via file uploads to internet-facing services using ClamAV, but requires specific file submission vectors.
🏢 Internal Only: LOW - Requires attacker to submit crafted PDFs to internal systems running ClamAV, limiting exposure to internal threats.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires submitting a crafted PDF file to be scanned by ClamAV, which is straightforward for attackers with file upload capabilities.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.4.1, 1.3.3, 1.0.7, 0.103.12

Vendor Advisory: https://blog.clamav.net/2024/09/clamav-141-132-107-and-010312-security.html

Restart Required: Yes

Instructions:

1. Download latest patched version from clamav.net 2. Stop ClamAV services 3. Install updated version 4. Update virus definitions 5. Restart ClamAV services

🔧 Temporary Workarounds

Disable PDF scanning

all

Temporarily disable PDF file scanning in ClamAV configuration to prevent exploitation

Edit clamd.conf and add: ScanPDF no
Edit freshclam.conf if applicable

Restrict file uploads

all

Implement strict file upload validation to block suspicious PDF files before they reach ClamAV

🧯 If You Can't Patch

  • Implement network segmentation to isolate ClamAV servers from untrusted networks
  • Deploy additional file validation layers before PDFs reach ClamAV scanning

🔍 How to Verify

Check if Vulnerable:

Run: clamscan --version and check if version matches affected range

Check Version:

clamscan --version | head -1

Verify Fix Applied:

Verify version is 1.4.1, 1.3.3, 1.0.7, or 0.103.12 or higher

📡 Detection & Monitoring

Log Indicators:

  • ClamAV process crashes
  • Scanning service restarts
  • Error messages related to PDF parsing

Network Indicators:

  • Unusual PDF file uploads to systems using ClamAV
  • Multiple failed scan attempts

SIEM Query:

source="clamav" AND ("crash" OR "segfault" OR "out of bounds")

🔗 References

📤 Share & Export