Bug 2499616 - CVE-2026-12080 qemu: qemu-guest-agent: Local privilege escalation via symlink attack in guest-ssh-add-authorized-keys [fedora-all]
Summary: CVE-2026-12080 qemu: qemu-guest-agent: Local privilege escalation via symlink...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: 45
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Fedora Virtualization Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: {"flaws": ["46bf395d-c090-4a76-9cc0-9...
Depends On:
Blocks: CVE-2026-12080
TreeView+ depends on / blocked
 
Reported: 2026-07-13 09:18 UTC by Mauro Matteo Cascella
Modified: 2026-08-17 15:18 UTC (History)
8 users (show)

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


Attachments (Terms of Use)

Description Mauro Matteo Cascella 2026-07-13 09:18:56 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 local privilege escalation vulnerability was found in qemu-guest-agent (qga) in the guest-ssh-add-authorized-keys command handler (qga/commands-posix-ssh.c).

When qmp_guest_ssh_add_authorized_keys adds an SSH key for an existing local user, the agent (running as root) checks whether the user's .ssh directory exists using g_file_test with G_FILE_TEST_IS_DIR, which follows symbolic links. It then writes the authorized_keys file via g_file_set_contents (atomic tmp+rename) and changes ownership with a plain chown() — not lchown() or fchown() — so the chown follows symlinks.

A local unprivileged user who controls their home directory can exploit this in two ways:

1. Deterministic directory-symlink bypass (no race): The user creates ~/.ssh as a symlink to a root-owned directory. The IS_DIR test passes (it follows symlinks), mkdir_for_user is skipped, and root writes and chowns a file inside the target directory to the attacker.

2. TOCTOU file-symlink race: Between the atomic rename (g_file_set_contents) and the subsequent chown(), the attacker replaces the authorized_keys path with a symlink to an arbitrary root-owned file. The chown follows the symlink and transfers ownership to the attacker.

In both cases, the attacker gains ownership of arbitrary root-owned files or directories, which can be rewritten to obtain full root access.

The vulnerability requires the host or a management layer (e.g., libvirt virDomainAuthorizedSSHKeysSet, OpenStack Nova, oVirt/RHV) to trigger guest-ssh-add-authorized-keys for the attacker's existing account. The attacker cannot self-trigger the command; it arrives from the host over the QMP/virtio-serial channel.

No privilege drop (seteuid/setuid/setresuid/setfsuid) is performed in the affected code path; all file operations execute with root effective UID.

Comment 1 Aoife Moloney 2026-08-17 15:18:45 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 45 development cycle.
Changing version to 45.


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