CVE-2022-20770
📋 TL;DR
A vulnerability in the CHM file parser of ClamAV allows an unauthenticated remote attacker to cause a denial of service condition on affected devices. This affects ClamAV versions 0.104.0 through 0.104.2 and LTS version 0.103.5 and earlier. Systems using ClamAV for scanning CHM files are vulnerable.
💻 Affected Systems
- Clam AntiVirus (ClamAV)
📦 What is this software?
Clamav by Clamav
Clamav by Clamav
Fedora by Fedoraproject
Fedora by Fedoraproject
Fedora by Fedoraproject
⚠️ Risk & Real-World Impact
Worst Case
Complete service disruption of ClamAV scanning functionality, potentially affecting dependent security services like email filtering or file scanning gateways.
Likely Case
ClamAV process crashes when processing malicious CHM files, causing temporary scanning interruptions until service restarts.
If Mitigated
Minimal impact with proper network segmentation and monitoring; scanning services automatically restart with minimal downtime.
🎯 Exploit Status
The vulnerability requires sending a specially crafted CHM file to trigger the DoS. No authentication is required if ClamAV processes files from untrusted sources.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 0.104.3 and 0.103.6
Vendor Advisory: https://blog.clamav.net/
Restart Required: Yes
Instructions:
1. Check current ClamAV version: clamscan --version
2. Stop ClamAV service: systemctl stop clamav-freshclam clamav-daemon
3. Update via package manager: apt update && apt upgrade clamav (Debian/Ubuntu) or yum update clamav (RHEL/CentOS)
4. Restart services: systemctl start clamav-freshclam clamav-daemon
5. Verify update: clamscan --version should show 0.104.3+ or 0.103.6+
🔧 Temporary Workarounds
Disable CHM file scanning
linuxTemporarily disable scanning of CHM files in ClamAV configuration
Edit /etc/clamav/clamd.conf and add: ArchiveBlockEncrypted no
Add to /etc/clamav/freshclam.conf: ArchiveBlockEncrypted no
Restart ClamAV: systemctl restart clamav-daemon
Implement file size limits
linuxLimit maximum file size for scanning to reduce impact
Edit /etc/clamav/clamd.conf: MaxFileSize 10M
Restart ClamAV: systemctl restart clamav-daemon
🧯 If You Can't Patch
- Isolate ClamAV services in separate network segments with strict access controls
- Implement monitoring and alerting for ClamAV process crashes with automated restart scripts
🔍 How to Verify
Check if Vulnerable:
Run: clamscan --version | grep -E '0\.(104\.[0-2]|103\.[0-5])' - if output shows these versions, system is vulnerable
Check Version:
clamscan --version
Verify Fix Applied:
Run: clamscan --version | grep -E '0\.(104\.[3-9]|103\.[6-9])' - if output shows patched versions, fix is applied
📡 Detection & Monitoring
Log Indicators:
- ClamAV daemon crashes in system logs
- Repeated ClamAV service restarts
- Failed scan attempts for CHM files
Network Indicators:
- Unusual CHM file uploads to systems using ClamAV
- Spike in file uploads to scanning endpoints
SIEM Query:
source="clamav" AND ("crash" OR "segmentation fault" OR "aborted")
🔗 References
- https://lists.debian.org/debian-lts-announce/2022/06/msg00004.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7RV6BLIATIJE74SQ6NG5ZC4JK5MMDQ2R/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BX5ZXNHP4NFYQ5BFSKY3WT7NTBZUYG7L/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/N4NNBIJVG6Z4PDIKUZXTYXICYUAYAZ56/
- https://security.gentoo.org/glsa/202310-01
- https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-clamav-dos-prVGcHLd
- https://lists.debian.org/debian-lts-announce/2022/06/msg00004.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7RV6BLIATIJE74SQ6NG5ZC4JK5MMDQ2R/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BX5ZXNHP4NFYQ5BFSKY3WT7NTBZUYG7L/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/N4NNBIJVG6Z4PDIKUZXTYXICYUAYAZ56/
- https://security.gentoo.org/glsa/202310-01
- https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-clamav-dos-prVGcHLd