CVE-2023-20052
Medium · 5.3CVSS
5.3
EPSS
7.0%
Published
Mar 1, 2023
CISA due date
—
Cloudanix analysis
A problem in the file-scanning software lets attackers read pieces of other files on the computer simply by sending one specially made file to be checked.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Library
- Class
- XXE
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
XML external entity injection in the DMG file parser enables the ClamAV scanning process to resolve external entities and leak bytes from any locally readable file.
Why it matters to the business
Attackers may obtain sensitive configuration, credential, or data files accessible to the scanner, raising the chance of targeted data theft or follow-on compromise with moderate urgency given the 1325 days since disclosure and low EPSS trend.
How an attack unfolds
An attacker prepares a DMG archive embedding a malicious XML document that references an external entity pointing to a target file on the system, then delivers the file to any ClamAV instance performing scans; the parser substitutes the entity and returns the leaked content to the attacker.
How to fix it
Upgrade ClamAV to a version newer than 1.0.0, 0.105.1, or 0.103.7; apply the exact fixed packages listed for each affected distribution (mediawiki 1:1.19.2-1 on Debian 11/12/13 and 1:1.19.14+dfsg-1 on Ubuntu 14.04 LTS) and restart all scanning services.
How to confirm the fix worked
Confirm the installed ClamAV version is newer than the vulnerable releases, run a test DMG containing a benign XXE payload and verify no external content is leaked, and review release notes or package changelogs for the XXE parser fix.
Typical attack path
- Create a DMG container containing an XXE payload in its XML metadata
- Submit the crafted DMG to a ClamAV scanner over the network or via file upload
- ClamAV opens the DMG and enables XML entity substitution during parsing
- Entity expansion reads bytes from an arbitrary file readable by the ClamAV process
- Leaked bytes are returned in the scan response or error output
How to detect it
Review ClamAV process logs and file-access audit trails for unexpected reads of configuration or credential files during DMG scans; correlate scan start times with unusual outbound or error responses containing file contents.
What your security team should do
- Prioritize patching all ClamAV instances within the next maintenance window
- Restrict file-system permissions of the ClamAV process to the minimum required directories
- Disable DMG scanning if the feature is not needed until patches are applied
- Add outbound network controls that prevent the scanner from fetching external entities
The record
On Feb 15, 2023, the following vulnerability in the ClamAV scanning library was disclosed: A vulnerability in the DMG file parser of ClamAV versions 1.0.0 and earlier, 0.105.1 and earlier, and 0.103.7 and earlier could allow an unauthenticated, remote attacker to access sensitive information on an affected device. This vulnerability is due to enabling XML entity substitution that may result in XML external entity injection. An attacker could exploit this vulnerability by submitting a crafted DMG file to be scanned by ClamAV on an affected device. A successful exploit could allow the attacker to leak bytes from any file that may be read by the ClamAV scanning process.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:10 | clamav | 0 | 0.103.8+dfsg-0+deb10u1 |
| Debian:11 | clamav | 0 | 0.103.8+dfsg-0+deb11u1 |
| Debian:12 | clamav | 0 | 1.0.1+dfsg-1 |
| Debian:13 | clamav | 0 | 1.0.1+dfsg-1 |
| Mageia:8 | clamav | 0 | 0.103.8-1.mga8 |
| SUSE:Enterprise Storage 7 | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Enterprise Storage 7.1 | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-ESPOS | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP4 | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise Real Time 15 SP3 | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise Server 12 SP2-BCL | clamav | 0 | 0.103.8-33.53.1 |
| SUSE:Linux Enterprise Server 12 SP4-LTSS | clamav | 0 | 0.103.8-33.53.1 |
| SUSE:Linux Enterprise Server 12 SP5 | clamav | 0 | 0.103.8-3.24.1 |
| SUSE:Linux Enterprise Server 15 SP1-LTSS | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise Server 15 SP2-LTSS | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise Server 15 SP3-LTSS | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP4 | clamav | 0 | 0.103.8-33.53.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP5 | clamav | 0 | 0.103.8-3.24.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP2 | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP3 | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Manager Proxy 4.2 | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:Manager Server 4.2 | clamav | 0 | 0.103.8-150000.3.44.1 |
| SUSE:OpenStack Cloud 9 | clamav | 0 | 0.103.8-33.53.1 |
| SUSE:OpenStack Cloud Crowbar 9 | clamav | 0 | 0.103.8-33.53.1 |
| Ubuntu:18.04:LTS | clamav | 0 | 0.103.8+dfsg-0ubuntu0.18.04.1 |
| Ubuntu:20.04:LTS | clamav | 0 | 0.103.8+dfsg-0ubuntu0.20.04.1 |
| Ubuntu:22.04:LTS | clamav | 0 | 0.103.8+dfsg-0ubuntu0.22.04.1 |
| Ubuntu:Pro:14.04:LTS | clamav | 0 | 0.103.8+dfsg-0ubuntu0.14.04.1+esm1 |
| Ubuntu:Pro:16.04:LTS | clamav | 0 | 0.103.8+dfsg-0ubuntu0.16.04.1+esm1 |
| openSUSE:Leap 15.4 | clamav | 0 | 0.103.8-150000.3.44.1 |
| openSUSE:Tumbleweed | clamav | 0 | 0.103.8-1.1 |
Related vulnerabilities
- CVE-2023-20197 A vulnerability in the filesystem image parser for Hierarchical File System Plus (HFS+)… Also affects clamav
- CVE-2023-20032 On Feb 15, 2023, the following vulnerability in the ClamAV scanning library was… Also affects clamav
- CVE-2017-11423 The cabd_read_string function in mspack/cabd.c in libmspack 0.5alpha, as used in ClamAV… Also affects clamav
- CVE-2015-2305 Integer overflow in the regcomp implementation in the Henry Spencer BSD regex library… Also affects clamav
- CVE-2012-1457 The TAR file parser in Avira AntiVir 7.11.1.163, Antiy Labs AVL SDK 2.0.3.7, avast! Also affects clamav
- CVE-2012-1459 The TAR file parser in AhnLab V3 Internet Security 2011.01.18.00, Avira AntiVir… Also affects clamav
- CVE-2012-1458 The Microsoft CHM file parser in ClamAV 0.96.4 and Sophos Anti-Virus 4.61.0 allows remote… Also affects clamav
- CVE-2012-1419 The TAR file parser in ClamAV 0.96.4 and Quick Heal (aka Cat QuickHeal) 11.00 allows… Also affects clamav