Debian LinuxOperating system · Debian

CVE-2017-16845

CRITICAL · 10.0 CVSS v3.1 Published 2017-11-17
Fix available
A fix is available. Upgrade to after 2.11.2 or later.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click Patch available

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 · unedited
hw/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 confidence

The 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.

MitigationUpgrade 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.

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
Debian LinuxOperating system
Affected:= 8.0= 9.0
Ubuntu LinuxOperating system
Affected:= 14.04= 16.04= 17.10= 18.04
QemuApplication
Affected:<= 2.11.2

CVSS 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 checks

Work through these to decide whether this CVE applies to you.

  1. Identify QEMU version
    Run `qemu-system-x86_64 --version` or check the installed package version with `dpkg -l qemu-system-x86` (Debian/Ubuntu) or your distribution's package manager
    Affected 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)
  2. Verify PS/2 device emulation is in use
    Inspect 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 process
    Affected if The VM configuration includes PS/2 keyboard or mouse emulation (common default in most VM configurations)
  3. Confirm migration capability is enabled
    Check 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)
  4. Inspect the QEMU source for the patch
    If 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Upgrade available Upgrade to a release after 2.11.2
Vendor patch lists.gnu.org →
Interim mitigation

Upgrade 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.

Recommended fix High confidence

QEMU 2.12.0 or later; Debian 8/9 security updates; Ubuntu 14.04/16.04/17.10/18.04 security updates

  1. 1. Identify the current QEMU version installed: `qemu-system-x86_64 --version` or `dpkg -l | grep qemu`
  2. 2. For Debian systems: Run `apt-get update` and `apt-get install qemu` to get the latest patched version for your Debian release
  3. 3. For Ubuntu systems: Run `sudo apt-get update && sudo apt-get install qemu` to apply Ubuntu security patches
  4. 4. Alternatively, upgrade to QEMU 2.12.0 or later from source if using upstream QEMU
  5. 5. After upgrade, restart any running QEMU instances to ensure the patched version is in use
  6. 6. Verify the fix is applied by checking the ps2.c file for the added validation of 'rptr' and 'count' parameters
Caveat Upgrading QEMU may require updating associated tooling or scripts; some older VM configurations may need adjustment for compatibility with newer QEMU versions

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Debian Linux Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing3.0 h
  • Review / QA1.0 h
10.0 hours of engineering $1,750
Get the upgrade done

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2017-16845 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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