Bug 2531811 (CVE-2026-77159) - CVE-2026-77159 libvirt: Unsafe chown in qemuTPMEmulatorPrepareHost() allows arbitrary file ownership change via symlink
Summary: CVE-2026-77159 libvirt: Unsafe chown in qemuTPMEmulatorPrepareHost() allows a...
Keywords:
Status: NEW
Alias: CVE-2026-77159
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On: 2531818
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-09-11 09:45 UTC by OSIDB Bzimport
Modified: 2026-09-11 10:08 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-09-11 09:45:17 UTC
A symlink-following flaw was found in libvirt's qemuTPMEmulatorPrepareHost() function (src/qemu/qemu_tpm.c). The function uses a path-based chown() to set ownership of the swtpm logfile without verifying that the path is not a symbolic link. Since the log directory is writable by the swtpm user, a local attacker with access to the swtpm account can replace the logfile with a symlink pointing to an arbitrary file. When libvirtd (running as root) starts a QEMU domain with an emulated TPM, it follows the symlink and transfers ownership of the target file to swtpm:swtpm, allowing the attacker to then modify that file.

The upstream fix replaces the path-based chown() with open(O_NOFOLLOW) + fchown() on the file descriptor.

External reference: https://gitlab.com/libvirt/libvirt/-/work_items/909


Note You need to log in before you can comment on or make changes to this bug.