CyberSecBulletin
CVE-2022-3872NVD status: Modified

QEMU: Off-by-one Error

CVE-2022-3872 is a high-severity off-by-one error vulnerability in QEMU, with a CVSS 3.1 base score of 8.6 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected QEMU versions: Affected: up to latest v7.1.0-rc4. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 1.1% chance of exploitation within 30 days, higher than 66% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Check which version of QEMU you run against the affected versions below, and install the vendor's latest release.
  2. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
QEMUQEMUAffected: up to latest v7.1.0-rc4Not stated

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
NoneNo account or login is needed.
User interaction
NoneNo action by a victim is required.
Scope
ChangedThe attack can reach beyond the vulnerable component into other systems.
Confidentiality
NoneNo data is disclosed.
Integrity
NoneNothing can be modified.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:N/A:H. Scored by NVD.

Scoring systemScoreSeverityScored by
CVSS 3.18.6HighNVD
CVSS 3.18.6HighCISA (ADP)

Official description

An off-by-one read/write issue was found in the SDHCI device of QEMU. It occurs when reading/writing the Buffer Data Port Register in sdhci_read_dataport and sdhci_write_dataport, respectively, if data_count == block_size. A malicious guest could use this flaw to crash the QEMU process on the host, resulting in a denial of service condition.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Off-by-one Error

A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.

How developers prevent this class of flaw

  • When copying character arrays or using character manipulation methods, the correct size parameter must be used to account for the null terminator that needs to be added at the end of the array. Some examples of functions susceptible to this weakness in C include strcpy(), strncpy(), strcat(), strncat(), printf(), sprintf(), scanf() and sscanf().

More Off-by-one Error vulnerabilities (CWE-193)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Patches and release notes

Third-party and government advisories

Other vulnerabilities in QEMU

All QEMU vulnerabilities

Recent Off-by-one Error vulnerabilities

Spotted an error? Tell us.