cbcvebase.
CVE-2018-12617
published 2018-06-21

CVE-2018-12617: qmp_guest_file_read in qga/commands-posix.c and qga/commands-win32.c in qemu-ga (aka QEMU Guest Agent) in QEMU 2.12.50 has an integer overflow causing a…

PriorityP260high7.5CVSS 3.1
AVNACLPRNUINSUCNINAH
EXPLOIT
EPSS
25.35%
97.7th percentile
qmp_guest_file_read in qga/commands-posix.c and qga/commands-win32.c in qemu-ga (aka QEMU Guest Agent) in QEMU 2.12.50 has an integer overflow causing a g_malloc0() call to trigger a segmentation fault when trying to allocate a large memory chunk. The vulnerability can be exploited by sending a crafted QMP command (including guest-file-read with a large count value) to the agent via the listening socket.

Affected

15 ranges
VendorProductVersion rangeFixed in
canonicalubuntu_linux
canonicalubuntu_linux
canonicalubuntu_linux
canonicalubuntu_linux
debiandebian_linux
debiandebian_linux
debianqemu< qemu 1:3.1+dfsg-1 (bookworm)qemu 1:3.1+dfsg-1 (bookworm)
qemuqemu<= 2.12.50
qemuqemu>= 0 < 1:3.1+dfsg-11:3.1+dfsg-1
qemuqemu>= 0 < 1:3.1+dfsg-11:3.1+dfsg-1
qemuqemu>= 0 < 1:3.1+dfsg-11:3.1+dfsg-1
qemuqemu>= 0 < 1:3.1+dfsg-11:3.1+dfsg-1
qemuqemu>= 0 < 2.0.0+dfsg-2ubuntu1.442.0.0+dfsg-2ubuntu1.44
qemuqemu>= 0 < 1:2.5+dfsg-5ubuntu10.331:2.5+dfsg-5ubuntu10.33
qemuqemu>= 0 < 1:2.11+dfsg-1ubuntu7.81:2.11+dfsg-1ubuntu7.8

Detection & IOCsextracted from sources · hover to see the quote

command{"execute":"guest-file-read", "arguments":{"handle":1000,"count":4294967295}}
path/tmp/qga.sock
  • Monitor QMP traffic on the qemu-ga listening socket for guest-file-read commands with a count value of 4294967295 (0xFFFFFFFF) or other abnormally large values indicative of integer overflow exploitation.
  • Alert on qemu-ga process crashes (segmentation fault / SIGSEGV) immediately following receipt of a guest-file-read QMP command, as this is the observable effect of successful exploitation.
  • Look for socat or similar tools connecting to the qemu-ga UNIX socket (/tmp/qga.sock or equivalent) from unexpected processes, as the exploit requires direct socket access.
  • ·The vulnerable code path (qmp_guest_file_read) is only reachable if qemu-ga (QEMU Guest Agent) is running and listening on a socket. QEMU KVM builds for OpenStack (qemu-kvm-rhev) do not build the guest agent and are therefore not affected.
  • ·The fix restricts guest-file-read count to a maximum of 48 MB; deployments should verify they are running a patched version incorporating upstream commit 1329651fb4.
  • ·The exploit requires the attacker to know or guess the correct file handle value returned by guest-file-open, as different files will have different handle values.

CVSS provenance

nvdv3.17.5HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
nvdv2.05.0MEDIUMAV:N/AC:L/Au:N/C:N/I:N/A:P
osv7.5HIGH
vendor_debian7.5LOW
vendor_redhat7.5HIGH
vendor_ubuntu6.5MEDIUM
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.