QEMU CVE-2023-42467 Patch: SCSI Block Size DoS Crash Fixed

  • Thread Author
QEMU hosts worldwide were quietly at risk of abrupt, complete shutdowns after a subtle SCSI emulation bug allowed a guest to trigger a division-by-zero that kills the QEMU process and the running virtual machine itself, a denial-of-service flaw tracked as CVE‑2023‑42467. The defect—rooted in how QEMU’s SCSI disk emulation validates (or fails to validate) block‑size values—was fixed upstream by disallowing block sizes smaller than 512 bytes; operators and vendor packagers later published fixes and advisories to close the window of exposure. (gitlab.com)

Neon-blue data center displays storage warnings: blocksize 256, SCSI disk, and a commit ID.Background​

Virtualization platforms expose a layered attack surface: guest software can, at times, interact with host-side device emulation code in unpredictable ways. QEMU’s hardware emulation stack includes a long-lived SCSI disk emulation module, and during normal SCSI command handling it computes sector counts and sizes using the emulated disk’s reported block size. A logic gap in the code permitted a block-size of 256 bytes to be accepted and stored; that value later produced an arithmetic division by zero in scsi_disk_reset (and related paths), immediately terminating the QEMU process and the guest. This is the technical core of CVE‑2023‑42467.
QEMU and its downstream packagers (RHEL, Debian, SUSE and others) tracked the issue, and the upstream project issued a focused fix: refuse block sizes below the minimum sector size of 512 bytes so that subsequent arithmetic never divides by zero. The upstream code change is recorded in commit 7cfcc79b (authored 25 Sep 2023), and the patch was included in stable release updates. (gitlab.com) (lists.gnu.org)

What exactly went wrong: a short technical post‑mortem​

The vulnerable code path​

At the heart of the issue is a small sequence of operations that look, at first glance, routine:
  • The SCSI emulation accepts a mode select command that can contain block descriptor data, including a block size value.
  • QEMU’s scsi_disk_emulate_mode_select code validated and updated s->qdev.blocksize from the command’s payload.
  • Later, code performing sector arithmetic executes expressions like:
  • nb_sectors /= (s->qdev.blocksize / BDRV_SECTOR_SIZE);
  • If s->qdev.blocksize was set to 256, then (s->qdev.blocksize / BDRV_SECTOR_SIZE) evaluates to (256 / 512) which is zero in integer division, and the left-hand expression divides by zero — a run‑time exception that crashes QEMU immediately.
This chain—accept a nonstandard small block size, then use integer arithmetic that assumes a block size >= 512—was the precise weak link. The resulting crash causes total, immediate loss of availability for that QEMU process and any guests it hosts. (gitlab.com)

Why this is a high‑impact availability problem​

The vulnerability does not produce a subtle resource leak or data corruption; it produces a deterministic, immediate termination of the QEMU process when exercised. That means:
  • Guests stop running instantly and without warning.
  • Host virtualization supervisors (libvirt, cloud orchestrators) may see VMs crash and potentially restart, but the attacker can repeatedly trigger the condition.
  • For multi‑tenant providers or automated testbeds hosting many guests on a single hypervisor process, the outcome can be a widespread outage.
Because the impact is availability-only (no confidentiality or integrity breach is implied by the reported behavior), the primary risk metrics are operational: unplanned downtime, failed services, and potential cascading failures in orchestration systems. Multiple public vulnerability databases and advisories catalog this as a DoS by division‑by‑zero in QEMU through 8.0.0.

Timeline and upstream response​

  • Discovery and assignment: CVE‑2023‑42467 was published in September 2023 and added to standard vulnerability lists shortly thereafter. The technical description identifies the vulnerable location as hw/scsi/scsi-disk.c.
  • Upstream patch: QEMU developers committed a minimal, surgical fix that disallows block sizes smaller than 512 bytes in scsi_disk_emulate_mode_select. The change prevents the problematic 256-byte assignment and thereby avoids the later divide-by-zero arithmetic. Commit 7cfcc79b is the canonical upstream fix. (gitlab.com)
  • Stable branch propagation: The patch was cherry-picked into stable branch updates and included in the QEMU stable patch rounds announced on the qemu-stable mailing list. Conscientious downstream vendors integrated the fix into their package updates. (lists.gnu.org)
Multiple vulnerability catalogues and vendor advisories record the issue and recommended upgrades; the OSV and RHEL advisory chains list vendor-specific package revisions and errata that remediate the vulnerability. This coordinated flow—from identification, to upstream fix, to downstream packaging—is how most open‑source runtime vulnerabilities are reliably closed.

Who and what is affected​

  • Affected software: QEMU versions through 8.0.0 (upstream releases prior to the upstream patch). Instances running older QEMU binaries that did not include the fix remained vulnerable.
  • Attack vector: Local (guest to host); the exploit requires the guest to issue SCSI commands intended to set block descriptor fields, i.e., the attacker must have control inside the a the crafted SCSI command. This makes the attack more of a tenant‑in‑guest problem than a network‑level remote exploit, though threats differ by deployment model.
  • Privilege requirements: A malicious or compromised guest that can issue SCSI commands to its emulated device is sufficient; many guests running unprivileged userland can still interact with emulated SCSI devices via standard device access. The vulnerability is therefore realistic in multi‑tenant or untrusted‑guest scenarios.
Community monitoring and vendor trackers saw the issue enter advisories and package updates in the normal cadence following the upstream fix. Our forum’s vulnerability tracking and incident threads have historically called out similar QEMU DoS risks, and those archival threads show how quickly virtualization vendors respond once an upstream fix is published.

Mitigation and remediation: practical steps for administrators​

If you operate QEMU in any capacity—standalone, under libvirt, or as part of a cloud stack—follow these steps to close CVE‑2023‑42467 exposure.
  • Inventory and identify (immediately)
  • Determine all hosts running QEMU and record their QEMU version numbers.
  • Include hypervisor processes run by systemd units, containerized QEMU instances, and any appliance images that bake QEMU binaries into their images.
  • Patch or upgrade (immediately where possible)
  • Upgrade QEMU to a version that includes the upstream commit 7cfcc79b (post‑September 2023 stable releases), or apply your vendor’s security update. Many Linux distributions and commercial vendors released packages with the fix; rely on vendor advisories for exact package versions. (gitlab.com)
  • If you use packaged QEMU from a distribution, prefer the distribution’s security packages rather than manually swapping binaries; vendor packaging often includes backports and integration work that reduce regression risk.
  • Short‑term hardening (if immediate patching is not possible)
  • Reduce guest privileges and limit which guests have access to SCSI emulated devices when possible.
  • Consider blocking guest‑initiated device control pathways via policy or configuration (for example, limit passthrough of SCSI devices or disallow destructive SCSI commands from untrusted guests).
  • Monitor for abnormal guest behavior that attempts to issue unusual SCSI mode select/mode sense sequences.
  • Validate and test (post‑patch)
  • After applying the vendor update, restart QEMU/libvirt and verify guest operations. Confirm the updated QEMU binary includes the commit or the vendor’s fix identifier.
  • Consider scripted tests that exercise SCSI mode select/get paths to confirm no crash occurs under the prior test pattern.
  • Longer term controls
  • Add QEMU version and vulnerability checks to your regular vulnerability scanning and CI/CD pipelines.
  • For providers and multi‑tenant operators, enforce stronger isolation (hardware pass‑through, dedicated host tenancy) for tenants that require higher trust boundaries.
These steps balance immediacy with caution—patch first, then harden and test. Where vendor-provided updates exist, those are the safest route because they include distribution‑specific backports and QA.

Vendor response and package status (what operators should look for)​

Different distributions and vendors remediate vulnerabilities on their own timetables. A few representative records and the types of indicators you should seek:
  • Upstream commit and stable release: commit 7cfcc79b in the QEMU upstream repository contains the actual code change that disallows sub‑512 block sizes. If your QEMU binary or source tree references that commit or includes the same patch, you have the upstream fix. (gitlab.com)
  • Distribution advisories: enterprise distributions publish RHSA/SUSE/DEBIAN advisories listing exact package versions that contain the fix. For example, Red Hat’s errata and Snyk’s RHEL advisory entries identify package update versions operators should apply. Confirm via your distribution’s security feed.
  • OSV / CVE indexing: central registries like OSV and the NVD record the vulnerability metadata and downstream advisories; use those as cross‑checks during triage. OSV collates distribution advisories and can show whether a downstream RHEL/SUSE/SUSE package ID or Debian fix exists.
  • Mailing list / stable patch announcements: the qemu-stable mailing list contains the narrative and patch diffs explaining why the change was necessary, which is helpful for audit and for understanding backward‑compatibility implications. (lists.gnu.org)
When you patch, validate the vendor package release notes include CVE‑2023‑42467 or the specific fix description (“Disallow block sizes smaller than 512 in hw/scsi/scsi-disk.c”) before deployment.

Attack scenarios and realistic risk modeling​

CVE‑2023‑42467 is not an RCE or data‑exfiltration bug; its primary effect is availability loss. That makes the most likely attacker models:
  • Malicious tenant or compromised guest: An attacker with control of a guest OS (or code execution inside the guest) crafts SCSI commands that set a small block size and then trigger code paths that do arithmetic based on that value. This will terminate the QEMU process for that VM and possibly affect other guests if that hypervisor process hosts multiple VMs.
  • Multi‑tenant impact: Providers running many guests on a single host could face repeated, automated attacks; a guest that can be induced to issue the SCSI sequence can be used as an instrument to create recurring outages.
  • Low‑complexity exploit: Because the vulnerability depends on specific SCSI command semantics rather than a complex memory corruption exploit, exploitation is relatively straightforward for an attacker with guest-level control. However, it is not a network‑level remote exploit from outside the guest host.
Given these scenarios, the severity is best understood as high for availability in multi‑tenant contexts and medium-to-low in single‑tenant, well‑isolated private deployments—if guests are strictly controlled and cannot issue arbitrary SCSI control commands. Operators must evaluate their tenant threat model and adjust urgency accordingly.

Strengths of the upstream fix — and residual risks​

Notable strengths​

  • The upstream patch is minimal and targeted: it directly prevents the problematic block-size assignment, reducing the risk of collateral behavior changes across the SCSI emulation codebase. The fix is conservative, disallowing block sizes below the canonical sector size and thereby avoiding arithmetic assumptions elsewhere. (gitlab.com)
  • The remediation followed an established, observable path: identification, upstream fix, stable branch backport, vendor packaging and advisory publication. That makes verification and auditing straightforward for downstream integrators. (lists.gnu.org)
  • Fixes were propagated to distributions and catalogued in public vulnerability registries (NVD/OSV), enabling automation to detect and flag vulnerable deployments.

Residual risks and caveats​

  • Patch coverage lag: Not every environment applies vendor updates promptly. Unpatched hosts remain vulnerable, and appliances or container images that include static QEMU binaries might never see distribution updates unless rebuilt.
  • Attack surface assumptions: The fix addresses the specific division-by-zero trigger; it does not alter the broader assumption that guests can control certain device parameters. Other unusual parameter combinations might still stress SCSI emulation in unexpected ways.
  • Operational blind spots: Visibility into whether a QEMU binary contains the exact commit varies by platform. Vendors sometimes backport a fix into a package without surface-level text referencing the commit, so administrators must validate package changelogs or vendor errata. OSV/OS vendors’ advisories are a useful cross-check.
Operators should treat the upstream fix as reliable but remain vigilant for new, related issues in storage emulation code; the SCSI stack is complex and has historically produced other guest-to-host DoS issues.

Verification checklist (what to verify after patching)​

  • Confirm the QEMU binary version or package release contains the upstream change (look for the CVE or the wording “Disallow block sizes smaller than 512” in the changelog). If using source builds, confirm commit 7cfcc79b or its cherry‑pick is present. (gitlab.com)
  • Restart QEMU/libvirt after a patch and exercise SCSI mode select/mode sense code paths in a controlled test environment to ensure no crash occurs under the previously problematic inputs.
  • Run distribution vulnerability scanners or OSV/NVD cross-checks against inventory to ensure no lingering vulnerable binaries are present.
  • Monitor hypervisor logs for suspicious or repeated SCSI control commands coming from guests, which could indicate attempted exploitation atter lessons for virtualization security
CVE‑2023‑42467 is a textbook example of how small arithmetic assumptions can produce outsized availability impacts when guest-controlled inputs bubble up into host-side emulation code. The incident underscores several enduring security practices:
  • Validate guest-supplied values defensively at the earliest point of entry—never assume a device descriptor is always sane.
  • Favor explicit bounds checks over implicit arithmetic assumptions; if later code divides, multiply or shifts by a value derived from guest input, the earliest code should ensure the divisor is nonzero and within a safe range.
  • Use automated vulnerability indexing and package feeds (NVD / OSV / vendor security advisories) as evidence of whether your environment is patched.
  • For multi‑tenant providers, maximize isolation between guests and minimize the set of guest‑controlled device interfaces exposed to untrusted tenants.
The QEMU community’s quick, transparent fix and the downstream vendors’ packaging reflect a mature ecosystem; nevertheless, the human operators and their patching cadence ultimately decide exposure windows.

Conclusion​

CVE‑2023‑42467 is a focused, availability‑impacting vulnerability in QEMU’s SCSI disk emulation that allowed a crafted or malicious guest to force a divide‑by‑zero crash in the hypervisor process. The issue was fixed upstream by refusing block sizes below the canonical 512‑byte sector size, a surgical remediation recorded in the QEMU commit history and propagated through stable branch updates and vendor advisories. Administrators should verify that their QEMU packages include the upstream fix (or equivalent vendor backport), apply vendor patches promptly, and harden guest device access where possible to reduce future exposure. Cross‑checking your inventory against authoritative vulnerability registries and vendor errata will close the operational window and restore confidence that QEMU hosts are no longer vulnerable to this immediate‑crash DoS condition. (gitlab.com) (lists.gnu.org)

Source: MSRC Security Update Guide - Microsoft Security Response Center
 

Back
Top