CVE-2021-3975
NixOS vulnerability analysis and mitigation

Overview

A use-after-free vulnerability (CVE-2021-3975) was discovered in libvirt, affecting versions prior to 7.1.0. The flaw exists in the qemuProcessHandleMonitorEOF() function where the qemuMonitorUnregister() function is called using multiple threads without adequate monitor lock protection. This vulnerability was discovered in November 2021 and affects various Linux distributions including Red Hat Enterprise Linux, Ubuntu, and Debian (Ubuntu Security, Debian LTS).

Technical details

The vulnerability stems from a thread synchronization issue in the libvirt's qemu process handling code. Specifically, in qemuProcessHandleMonitorEOF(), the qemuMonitorUnregister() function can be called by multiple threads simultaneously without proper lock protection, potentially leading to a use-after-free condition. The issue has been assigned a CVSS v3.1 base score of 5.3 (Medium) with vector AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H, indicating network accessibility with low attack complexity (NVD).

Impact

The vulnerability can be triggered by the virConnectGetAllDomainStats API when a guest is shutting down. When successfully exploited, it allows an unprivileged client with a read-only connection to perform a denial of service attack by causing the libvirt daemon to crash (Debian LTS).

Mitigation and workarounds

The vulnerability has been fixed in libvirt version 7.1.0 and later. The fix involves adding proper monitor locking in the qemuProcessHandleMonitorEOF function. The patch has been backported to various Linux distributions through their security updates. Organizations should update their libvirt installations to the patched versions available through their distribution's package management system (GitHub Commit).

Additional resources


SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-20807MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20806MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20805MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20804MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026
CVE-2025-20803MEDIUM6.7
  • NixOSNixOS
  • android
NoNoJan 06, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management