A flaw was found in libvirt. An unprivileged local user with access to a read-only socket can execute arbitrary commands by submitting a crafted nested Uniform Resource Identifier (URI). Because the privileged daemon executes external helper binaries during connection setup prior to applying read-only access restrictions, an attacker can exploit this issue to achieve local privilege escalation.
To mitigate this issue, restrict access to libvirt read-only Unix sockets so that only trusted accounts can connect to them.
On systems using the monolithic libvirtd, restrict the read-only socket by setting unix_sock_ro_perms = "0700" in /etc/libvirt/libvirtd.conf and restarting the service.
On systems using modular daemons (RHEL 9 and later), each daemon (virtqemud, virtstoraged, virtnetworkd, etc.) exposes its own read-only socket under /run/libvirt/. Restrict access to all *-sock-ro sockets by applying appropriate filesystem permissions or by overriding the systemd socket unit configurations.
Warning: restricting read-only socket permissions will prevent unprivileged users and monitoring tools from querying libvirt status. Restarting libvirt daemons will temporarily interrupt management connections.