CVE-2017-16845
Critical · 10.0CVSS
10.0
EPSS
2.9%
Published
Nov 17, 2017
CISA due date
—
Cloudanix analysis
A flaw in the virtual machine software lets attackers who can start a migration corrupt memory and potentially take control of the host system.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Application
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Failure to validate rptr and count fields in PS/2 device state during guest migration allows out-of-bounds memory access in the QEMU process.
Why it matters to the business
Attackers could crash virtual machines or read and write arbitrary host memory, risking data exposure or denial of service for any organization relying on QEMU-based virtualization.
How an attack unfolds
An attacker with network access to a migration endpoint supplies a malicious PS/2 device state that contains invalid rptr and count values; when migration occurs, QEMU performs an out-of-bounds access that can be leveraged for memory corruption.
How to fix it
Upgrade QEMU to a version that enforces bounds checking on rptr and count during PS/2 state loading; apply vendor patches for Debian and Ubuntu packages once available.
How to confirm the fix worked
Confirm the installed QEMU binary contains the upstream fix that validates rptr and count before accessing the PS/2 ring buffer; re-test migration with known-bad state values to verify rejection.
Typical attack path
- Identify a QEMU instance accepting incoming migrations
- Craft a PS/2 device state blob containing out-of-range rptr and count values
- Initiate or intercept a live migration that processes the malicious state
- Trigger the out-of-bounds read or write to corrupt memory or cause a crash
How to detect it
Review QEMU migration logs and core dumps for PS/2 ring-buffer access violations; correlate with network flows that carry migration data containing suspicious device state.
What your security team should do
- Prioritize patching all QEMU hosts that perform live migration
- Disable or restrict migration interfaces until patches are applied
- Monitor for unusual migration traffic and PS/2 device state anomalies
The record
hw/input/ps2.c in Qemu does not validate 'rptr' and 'count' values during guest migration, leading to out-of-bounds access.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | qemu | 0 | 1:2.12~rc3+dfsg-1 |
| Debian:12 | qemu | 0 | 1:2.12~rc3+dfsg-1 |
| Debian:13 | qemu | 0 | 1:2.12~rc3+dfsg-1 |
| Debian:8 | qemu | 0 | 1:2.1+dfsg-12+deb8u7 |
| Debian:9 | qemu | 0 | 1:2.8+dfsg-6+deb9u4 |
| SUSE:Linux Enterprise Desktop 12 SP2 | qemu | 0 | 2.6.2-41.37.1 |
| SUSE:Linux Enterprise Desktop 12 SP3 | qemu | 0 | 2.9.1-6.12.1 |
| SUSE:Linux Enterprise Server 12 SP2 | qemu | 0 | 2.6.2-41.37.1 |
| SUSE:Linux Enterprise Server 12 SP3 | qemu | 0 | 2.9.1-6.12.1 |
| SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 | qemu | 0 | 2.6.2-41.37.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP2 | qemu | 0 | 2.6.2-41.37.1 |
| SUSE:Linux Enterprise Server for SAP Applications 12 SP3 | qemu | 0 | 2.9.1-6.12.1 |
| Ubuntu:14.04:LTS | qemu | 0 | 2.0.0+dfsg-2ubuntu1.39 |
| Ubuntu:14.04:LTS | qemu | 0 | 2.0.0+dfsg-2ubuntu1.41 |
| Ubuntu:16.04:LTS | qemu | 0 | 1:2.5+dfsg-5ubuntu10.22 |
| Ubuntu:16.04:LTS | qemu | 0 | 1:2.5+dfsg-5ubuntu10.28 |
| Ubuntu:18.04:LTS | qemu | 0 | 1:2.11+dfsg-1ubuntu7.1 |
Related vulnerabilities
- CVE-2024-7730 A heap buffer overflow was found in the virtio-snd device in QEMU. Also affects qemu
- CVE-2024-3447 A heap-based buffer overflow was found in the SDHCI device emulation of QEMU. Also affects qemu
- CVE-2024-6519 A use-after-free vulnerability was found in the QEMU LSI53C895A SCSI Host Bus Adapter… Also affects qemu
- CVE-2024-8612 A flaw was found in QEMU, in the virtio-scsi, virtio-blk, and virtio-crypto devices. Also affects qemu
- CVE-2024-8354 A flaw was found in QEMU. Also affects qemu
- CVE-2024-7409 A flaw was found in the QEMU NBD Server. Also affects qemu
- CVE-2024-6505 A flaw was found in the virtio-net device in QEMU. Also affects qemu
- CVE-2024-4467 A flaw was found in the QEMU disk image utility (qemu-img) 'info' command. Also affects qemu