Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
ENV-CVE-2021-3975 — Aritifacts of docker env of CVE-2021-3975 | Kitploit
Tools/GitHubGitHub/yan5ui/env-cve-2021-3975
Container SecurityVulnerability AnalysisExploitationLearning & EducationBinary ExploitationLabs & Practice
GitHubyan5ui/env-cve-2021-3975

ENV-CVE-2021-3975

Aritifacts of docker env of CVE-2021-3975

View Repository
2 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

ENV-CVE-2021-3975 — libvirt vulnerability reproduction environment

This repository is a snapshot of the reproducible vulnerability environment for CVE-2021-3975 (libvirt qemuProcessHandleMonitorEOF use-after-free, CWE-416), exported from the corresponding container image yan5ui/cve-2021-3975:tier1 (based on ubuntu:20.04).

The environment performs a reproducible build from the vulnerable version source code, retaining the build artifacts, build scripts, and complete build log. It can be directly used for vulnerability reproduction and exploit verification.

Vulnerability Information

ItemValue
CVECVE-2021-3975
Projectlibvirt (7.1.0 series)
CWECWE-416 (Use-After-Free)
Vulnerable FunctionqemuProcessHandleMonitorEOF() (calls qemuMonitorUnregister())
Upstream Repositoryhttps://github.com/libvirt/libvirt

Trigger condition: qemuMonitorUnregister() is called from multiple threads in qemuProcessHandleMonitorEOF without adequate protection by the monitor lock; during guest shutdown, the UAF can be triggered via the virConnectGetAllDomainStats API, causing the libvirt daemon to crash.

Sanitizer and Vulnerability Type Correspondence

This environment selects compile-time instrumentation strategies based on the vulnerability's CWE category.

  • CWE-416 (Use-After-Free) → this image uses a plain debug build
  • Compiler: clang
  • Compile options: -O1 -g -fno-omit-frame-pointer

Note: UAF-type vulnerabilities are usually instrumented with ASan+UBSan. On the environment's target platform ubuntu:20.04, the system-provided toolchain (meson 0.53.2 + clang-10 + ld.bfd) cannot fully pass -fsanitize=address,undefined to the linking step of libvirt.so.0 during shared library linking (resulting in numerous unresolved symbol references to __asan_* / __ubsan_*). Therefore, this image uses a plain debug build with debug symbols (-O1, frame pointer retention). This build fully reproduces the vulnerable code path, and the crash can be located at the use-after-free point under a debugger. This build decision and reason are truthfully recorded in the sanitizer_downgrade_reason field of compile/BUILD_OK.

The build artifacts include the complete libvirt daemon and toolset, with the main binary at compile/artifacts/libvirtd (which is pointed to by compile/artifacts/main).

Directory Structure

root@kitploit:~
.
├── README.md            This file
├── description.md       Vulnerability description, vulnerable function source code excerpts, and reproduction task explanation
├── meta.json            Structured metadata (project, CWE, commit, source paths, etc.)
├── compile/             Build artifacts and build records
│   ├── build.sh         Reproducible build script (dependency installation + meson setup + ninja + artifact collection)
│   ├── deps.txt         List of apt dependencies required for building
│   ├── BUILD_OK         Build success record (build system, sanitizer and downgrade reason, artifact paths, etc.)
│   ├── build.log        Complete build log
│   └── artifacts/       Compiled artifacts
│       ├── libvirtd     Main daemon binary (process containing the vulnerable function)
│       ├── main         Symbolic link to libvirtd (unified entry name)
│       ├── virsh / virtqemud / virtlogd / ...   Other daemons and command-line tools
│       ├── libvirt.so.0.7001.0                   libvirt core shared library
│       └── libvirt_driver_qemu.so etc.           Various driver/storage backend shared libraries
├── src/
│   └── libvirt/         Complete source tree at the vulnerable commit
│       └── build/       Meson/Ninja out-of-source build directory (original location of build artifacts)
├── task/                Runtime mount directory for the exploit agent harness (empty in the image)
└── workspace/           Runtime working directory for the exploit agent harness (empty in the image)

About task/ and workspace/

These two directories are working directories used by the exploit agent harness during reproduction/exploitation: workspace/ serves as the agent's default workspace, and task/ is used to store inputs for a single reproduction task. Both are empty in the image and will be filled by the harness at runtime during reproduction. They are standard convention directories of the environment and do not contain build artifacts.

Reproduction Method

The build within the container is a Meson + Ninja out-of-source build (see compile/build.sh), with the build directory at /src/libvirt/build/. The main binary is compile/artifacts/libvirtd. Follow the task instructions in description.md: concurrently call virConnectGetAllDomainStats during guest shutdown to trigger the use-after-free in qemuProcessHandleMonitorEOF, causing the daemon to crash and thereby verify the vulnerability.

Download Tool