CVE-2021-3682: High severity Qemu Qemu vulnerability

Published Aug 3, 2021
·
Updated

A flaw was found in the USB redirector device (usb-redir) of QEMU. It occurs when dropping packets during a bulk transfer from a SPICE client due to the packet queue being full. More specifically, the usbredirbufferedbulkpacket() function calls bufpalloc() with an invalid pointer that points into the middle of a buffer controlled by the SPICE client. If the packet queue is full, bufpalloc() ends up freeing the same pointer passed as argument. A malicious SPICE client could use this flaw to make QEMU call free() with faked heap chunk metadata, resulting in a crash of QEMU or potential code execution with the privileges of the QEMU process on the host.

Upstream issue: https://gitlab.com/qemu-project/qemu/-/issues/491

Upstream fix: https://gitlab.com/qemu-project/qemu/-/commit/5e796671e6b8d5de4b0b423dce1b3eba144a92c9

Other sources

A flaw was found in the USB redirector device emulation of QEMU in versions prior to 6.1.0-rc2. It occurs when dropping packets during a bulk transfer from a SPICE client due to the packet queue being full. A malicious SPICE client could use this flaw to make QEMU call free() with faked heap chunk metadata, resulting in a crash of QEMU or potential code execution with the privileges of the QEMU process on the host.

Launchpad

Affected Software

10 affected componentsFixes available
debian/qemu<=1:3.1+dfsg-8+deb10u8, <=1:5.2+dfsg-11, <=1:3.1+dfsg-8
1:6.0+dfsg-31:5.2+dfsg-11+deb11u1
redhat/qemu<6.1.0
6.1.0
Qemu Qemu<6.1.0
Qemu Qemu=6.1.0-rc1
redhat Enterprise Linux=8.0
redhat Enterprise Linux=8.0
Debian Debian Linux=9.0
Debian Debian Linux=10.0
Debian Debian Linux=11.0
debian/qemu
1:5.2+dfsg-11+deb11u31:5.2+dfsg-11+deb11u21:7.2+dfsg-7+deb12u121:10.0.0~rc3+ds-2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/qemu to a version that resolves this vulnerability.

    Fixed in 1:6.0+dfsg-3Fixed in 1:5.2+dfsg-11+deb11u1
  2. Upgrade

    Upgrade redhat/qemu to a version that resolves this vulnerability.

    Fixed in 6.1.0
  3. Upgrade

    Upgrade debian/qemu to a version that resolves this vulnerability.

    Fixed in 1:5.2+dfsg-11+deb11u3Fixed in 1:5.2+dfsg-11+deb11u2Fixed in 1:7.2+dfsg-7+deb12u12Fixed in 1:10.0.0~rc3+ds-2
  4. Upgrade

    Upgrade qemu usb-redir (usb redirector device / usbredir_buffered_bulk_packet) to a version that resolves this vulnerability.

    Fixed in 6.1.0-rc2Patch gitlab.com/qemu-project/qemu/-/issues/491
  5. Compensating control

    If affected QEMU instances are exposed to untrusted SPICE clients, limit SPICE client access (e.g., only allow trusted clients/IPs) to reduce the chance of triggering the usb-redir bulk packet drop path that causes the invalid free.

Event History

Aug 5, 2021
CVE Published
via MITRE·07:51 PM
Data Sourced
via MITRE·07:51 PM
DescriptionWeakness
Data Sourced
via NVD·08:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jan 11, 2024
Data Sourced
via Launchpad·11:58 PM
Description
Sep 16, 2024
Data Sourced
via Ubuntu·02:34 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is CVE-2021-3682?

CVE-2021-3682 is a vulnerability in the USB redirector device emulation of QEMU.

2

How severe is CVE-2021-3682?

CVE-2021-3682 has a severity score of 8.5, which is considered high.

3

Which software versions are affected by CVE-2021-3682?

Versions prior to 6.1.0-rc2 of QEMU are affected by CVE-2021-3682.

4

How can I fix CVE-2021-3682?

To fix CVE-2021-3682, update QEMU to version 6.1.0 or later.

5

Where can I find more information about CVE-2021-3682?

You can find more information about CVE-2021-3682 at the following references: [Link 1](https://gitlab.com/qemu-project/qemu/-/issues/491), [Link 2](https://gitlab.com/qemu-project/qemu/-/commit/5e796671e6b8d5de4b0b423dce1b3eba144a92c9), [Link 3](https://gitlab.com/qemu-project/qemu/-/commit/b2d1fe67d09d2b6c7da647fbcea6ca0148c206d3).

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203