CVE-2021-1252

7.5 HIGH

📋 TL;DR

This vulnerability in ClamAV's Excel macro parser allows remote attackers to cause denial of service by sending specially crafted Excel files. When exploited, it causes the ClamAV scanning process to enter an infinite loop and hang. Organizations using ClamAV versions 0.103.0 or 0.103.1 for email scanning, file upload scanning, or endpoint protection are affected.

💻 Affected Systems

Products:
  • Clam AntiVirus (ClamAV)
Versions: 0.103.0 through 0.103.1
Operating Systems: All platforms running ClamAV
Default Config Vulnerable: ⚠️ Yes
Notes: Any ClamAV installation with Excel file scanning enabled is vulnerable. This includes email gateways, web application firewalls, file servers, and endpoints using ClamAV.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete DoS of ClamAV scanning services across all affected systems, potentially disrupting email filtering, file upload processing, and malware detection capabilities.

🟠

Likely Case

Targeted DoS attacks against specific ClamAV instances, causing scanning delays and service degradation for affected systems.

🟢

If Mitigated

Minimal impact with proper network segmentation and updated versions, though scanning performance may still be affected during attack attempts.

🌐 Internet-Facing: HIGH - ClamAV instances processing files from untrusted sources (email gateways, web uploads) are directly exposed to remote exploitation.
🏢 Internal Only: MEDIUM - Internal systems using ClamAV for file scanning could be targeted via internal attacks or compromised internal systems.

🎯 Exploit Status

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

Exploitation requires only sending a crafted Excel file to a vulnerable ClamAV instance. No authentication or special privileges needed.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.103.2 or later

Vendor Advisory: https://blog.clamav.net/2021/04/clamav-01032-security-patch-release.html

Restart Required: Yes

Instructions:

1. Download ClamAV 0.103.2 or later from clamav.net. 2. Stop ClamAV services. 3. Install the updated version. 4. Update virus definitions with 'freshclam'. 5. Restart ClamAV services.

🔧 Temporary Workarounds

Disable Excel macro scanning

linux

Temporarily disable scanning of Excel XLM macro files to prevent exploitation

Edit clamd.conf and add: 'ScanOLE2 no'
Restart clamd: 'systemctl restart clamav-daemon'

Rate limit file scanning

all

Implement rate limiting on file uploads and email attachments to reduce DoS impact

Configure rate limits in your web server/email gateway settings

🧯 If You Can't Patch

  • Implement network segmentation to isolate ClamAV instances from untrusted networks
  • Deploy WAF or IPS rules to block or quarantine Excel files with suspicious characteristics

🔍 How to Verify

Check if Vulnerable:

Run: 'clamscan --version' and check if version is 0.103.0 or 0.103.1

Check Version:

clamscan --version | grep ClamAV

Verify Fix Applied:

Run: 'clamscan --version' and confirm version is 0.103.2 or later

📡 Detection & Monitoring

Log Indicators:

  • ClamAV process hanging or not responding
  • High CPU usage by clamd process
  • Scan timeouts in application logs

Network Indicators:

  • Multiple Excel file uploads to scanning endpoints
  • Unusual traffic patterns to ClamAV services

SIEM Query:

source="clamav" AND ("hang" OR "timeout" OR "infinite loop") OR process_name="clamd" AND cpu_usage>90

🔗 References

📤 Share & Export