Bug 2531818 - CVE-2026-77159 libvirt: Unsafe chown in qemuTPMEmulatorPrepareHost() allows arbitrary file ownership change via symlink [fedora-all]
Summary: CVE-2026-77159 libvirt: Unsafe chown in qemuTPMEmulatorPrepareHost() allows a...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: rawhide
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Fedora Virtualization Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: {"flaws": ["4b26f56c-f480-4cb1-8dc9-a...
Depends On:
Blocks: CVE-2026-77159
TreeView+ depends on / blocked
 
Reported: 2026-09-11 10:08 UTC by Mauro Matteo Cascella
Modified: 2026-09-11 10:08 UTC (History)
9 users (show)

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


Attachments (Terms of Use)

Description Mauro Matteo Cascella 2026-09-11 10:08:06 UTC
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.

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.