CVE-2024-20328
Clam AntiVirus vulnerability analysis and mitigation

Overview

A command injection vulnerability (CVE-2024-20328) was discovered in ClamAV's VirusEvent feature. The vulnerability affects multiple versions of ClamAV ranging from 0.104 through 1.2.1, including all patch versions and LTS releases. The flaw allows local attackers to inject arbitrary commands with the privileges of the application service account (ClamAV Blog, NVD).

Technical details

The vulnerability stems from unsafe handling of file names in the VirusEvent feature of ClamAV's ClamD service. The issue occurs when processing the '%f' format string parameter in the VirusEvent configuration, which fails to properly sanitize file names. When the VirusEvent feature is configured in clamd.conf, an attacker can exploit this by supplying a file name containing command-line sequences that get executed through the '/bin/sh' shell. The vulnerability has been assigned a CVSS v3.1 base score of 5.3 (Medium) with the vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L (SecurityOnline, AttackerKB).

Impact

When successfully exploited, this vulnerability allows attackers to execute arbitrary commands with the privileges of the ClamAV service account. This is particularly concerning in environments where ClamAV runs with elevated privileges, such as mail servers where it's commonly used to scan files. The impact is heightened when ClamAV's daemon (clamd) runs as root (SecurityOnline).

Exploitability

The vulnerability requires local access and is exploitable when the VirusEvent feature is configured in ClamAV's configuration. A proof-of-concept (PoC) has been published demonstrating how an attacker can craft a malicious file name to trigger command execution. The vulnerability was discovered by security researcher Amit Schendel (SecurityOnline).

Mitigation and workarounds

ClamAV has released security updates to address this vulnerability in versions 1.2.2 and 1.0.5. The fix involves disabling the '%f' format string parameter in the VirusEvent feature. Administrators can continue to use the CLAM_VIRUSEVENT_FILENAME environment variable instead of '%f', but only from within an executable like a Python script, and not directly in the clamd.conf VirusEvent command (ClamAV Blog).

Additional resources


SourceThis report was generated using AI

Related Clam AntiVirus vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-20348HIGH7.5
  • Clam AntiVirus logoClam AntiVirus
  • clamav1.4
NoYesAug 07, 2026
CVE-2026-20347HIGH7.5
  • Clam AntiVirus logoClam AntiVirus
  • clamav
NoYesAug 07, 2026
CVE-2026-20346HIGH7.5
  • Clam AntiVirus logoClam AntiVirus
  • clamav
NoYesAug 07, 2026
CVE-2026-20345HIGH7.5
  • Clam AntiVirus logoClam AntiVirus
  • clamav
NoYesAug 07, 2026
CVE-2026-70622HIGH7.1
  • Clam AntiVirus logoClam AntiVirus
  • rust-cargo-c
NoNoAug 10, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management