CVE-2017-16845
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedhw/input/ps2.c in Qemu does not validate 'rptr' and 'count' values during guest migration, leading to out-of-bounds access.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceThe PS/2 keyboard/mouse controller emulation in QEMU (hw/input/ps2.c) lacks proper validation of the 'rptr' (read pointer) and 'count' values during guest virtual machine migration. When a VM is migrated, the unvalidated pointer and counter values are used to access memory buffers, allowing an attacker to trigger out-of-bounds read/write operations, potentially leading to memory corruption and arbitrary code execution on the host.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data= 8.0= 9.0= 14.04= 16.04= 17.10= 18.04<= 2.11.2CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Changed
- Confidentiality
- High
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify QEMU versionRun `qemu-system-x86_64 --version` or check the installed package version with `dpkg -l qemu-system-x86` (Debian/Ubuntu) or your distribution's package managerAffected if The installed QEMU version is 2.11.2 or lower, or falls within the affected distribution versions (Debian 8.0, 9.0; Ubuntu 14.04, 16.04, 17.10, 18.04)
-
Verify PS/2 device emulation is in useInspect VM configuration files (for libvirt: `virsh dumpxml <vm-name>`) and look for emulated input devices such as 'ps2' keyboard or mouse, or check for 'hw/input/ps2.c' being loaded in the QEMU processAffected if The VM configuration includes PS/2 keyboard or mouse emulation (common default in most VM configurations)
-
Confirm migration capability is enabledCheck if the VM has migration source/destination capability enabled: for libvirt, run `virsh dominfo <vm-name>` and look for migration settings, or verify libvirtd service is running with `systemctl status libvirtd`Affected if Migration functionality is available or has been used (the vulnerability is triggered during the migration operation itself)
-
Inspect the QEMU source for the patchIf QEMU was built from source, examine the file `hw/input/ps2.c` in the source tree and look for bounds checking on 'rptr' and 'count' variables (the fix adds validation before memory buffer access during migration)Affected if The source code lacks proper bounds checking for rptr and count values before using them in memory operations during migration state transfers
You are affected if your QEMU version is 2.11.2 or earlier, your VMs use PS/2 keyboard/mouse emulation, and migration functionality is available, as the vulnerability triggers when a VM with unvalidated PS/2 state is migrated.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedUpgrade QEMU to a version that includes the fix for CVE-2017-16845, or apply the upstream patch that adds bounds checking for 'rptr' and 'count' before using these values in memory operations during migration. Verify that migration functionality works correctly after applying the update.
QEMU 2.12.0 or later; Debian 8/9 security updates; Ubuntu 14.04/16.04/17.10/18.04 security updates
- 1. Identify the current QEMU version installed: `qemu-system-x86_64 --version` or `dpkg -l | grep qemu`
- 2. For Debian systems: Run `apt-get update` and `apt-get install qemu` to get the latest patched version for your Debian release
- 3. For Ubuntu systems: Run `sudo apt-get update && sudo apt-get install qemu` to apply Ubuntu security patches
- 4. Alternatively, upgrade to QEMU 2.12.0 or later from source if using upstream QEMU
- 5. After upgrade, restart any running QEMU instances to ensure the patched version is in use
- 6. Verify the fix is applied by checking the ps2.c file for the added validation of 'rptr' and 'count' parameters
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation4.0 h
- Testing3.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,800.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2017-16845 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2017-16845 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data