Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
cve-2026-12080-qemu-guest-agent-authorized-keys — Technical writeup of CVE-2026-12080: local privilege escalation in the QEMU Guest Agent (qga) guest-ssh-add-authorized-keys handler via symlink following. | Kitploit
Tools/GitHubGitHub/m8seven/cve-2026-12080-qemu-guest-agent-authorized-keys
Privilege EscalationVulnerability AnalysisExploitationSecurity VirtualizationPapers & ResearchLearning & Education
GitHubm8seven/cve-2026-12080-qemu-guest-agent-authorized-keys

cve-2026-12080-qemu-guest-agent-authorized-keys

Technical writeup of CVE-2026-12080: local privilege escalation in the QEMU Guest Agent (qga) guest-ssh-add-authorized-keys handler via symlink following.

View Repository
29 days agoNot yet reviewed
Share

CVE-2026-12080: QEMU Guest Agent guest-ssh-add-authorized-keys local privilege escalation

Local privilege escalation in the QEMU Guest Agent (qga) via symlink following in the guest-ssh-add-authorized-keys command handler. An unprivileged user inside the guest pre-stages a symlink in a target account's ~/.ssh, and the agent, running as root, follows it while creating and chowning authorized_keys, handing ownership of a root-controlled path to the unprivileged user.

This is a writeup of a vulnerability I reported and which was assigned CVE-2026-12080 by Red Hat Product Security (the CNA). It is published here as a technical record. The issue belongs to the same symlink-following authorized_keys class as a number of sibling findings in other agents; it is reported as that accepted class in a handler it had not yet been fixed in, not as a novel root cause.

Official references

  • Red Hat CVE record: https://access.redhat.com/security/cve/CVE-2026-12080
  • Red Hat Bugzilla flaw: https://bugzilla.redhat.com/show_bug.cgi?id=2499603
  • QEMU GitLab work item: https://gitlab.com/qemu-project/qemu/-/work_items/3929
  • Affected source: https://gitlab.com/qemu-project/qemu/-/blob/master/qga/commands-posix-ssh.c

The fix carries Reported-by: Valentino Paulon and Fixes: CVE-2026-12080.

CVECVE-2026-12080
ComponentQEMU qga/commands-posix-ssh.c, guest-ssh-add-authorized-keys handler (and the sibling remove/get handlers)
TypeElevation of Privilege (local). CWE-59 / CWE-61 (link following) with improper ownership management
CVSS7.3 (High) — CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Public2026-07-20
Reported byValentino Paulon

Summary

The guest agent exposes guest-ssh-add-authorized-keys, which writes a target user's ~/.ssh/authorized_keys. The handler builds the .ssh directory and the authorized_keys path from the target user's passwd home and then operates on those paths by name, as root, with no privilege drop:

  • it creates the directory and file along a path the target user owns and controls, following any symlink placed there, and
  • it changes ownership with a path-based chown that follows symlinks.

Because no seteuid/setegid drop is performed and the operations are name-based rather than performed relative to a safely-opened, symlink-refusing descriptor, an unprivileged user who controls the target home can redirect the agent's privileged create/chown onto a root-controlled path. Both exploitation variants below were reproduced end to end against qga 6.2.0 with the command enabled in its default configuration.

Two variants

Both confirmed end to end on a throwaway VM. victim is an unprivileged local user; the agent runs as root and the command is triggered exactly as a host operator would trigger it. Canaries stand in for sensitive root targets.

Variant A — deterministic directory-symlink bypass. The unprivileged user replaces (or pre-creates) ~/.ssh as a symlink to an existing root-owned directory. When the handler creates/chowns along that path, the root-owned directory's ownership is transferred to the unprivileged user. Deterministic, no race.

Variant B — TOCTOU file-symlink race. With ~/.ssh a normal directory, the user wins a rename-then-symlink race in the window between the handler's check and its create/chown of authorized_keys, so a new root-path file is created and chowned to the user. Reproduced by winning the race on a second iteration.

In both cases the unprivileged user ends up owning a root-controlled path and escalates by the standard follow-on (for example a new file under /etc/cron.d or /etc/sudoers.d, or ownership of a directory under /etc), where the user, now the owner, rewrites the target.

Root cause

The three guest-ssh-*-authorized-keys handlers performed their filesystem work as root, on attacker-reachable paths, by name:

  • directory and file creation along ~/.ssh without refusing a pre-existing symlink (no O_NOFOLLOW/O_EXCL open operated on through the resulting descriptor);
  • ownership changes with path-based chown rather than lchown/fchown on a safely-opened descriptor;
  • no effective-UID/GID drop to the target user around the I/O, so every operation ran with full root authority on a path the unprivileged user controlled.

The check-and-then-act structure on a name additionally left a TOCTOU window (Variant B) even where a single operation looked guarded.

Fix

The accepted fix changes the privilege model of all three handlers rather than patching one call site. A helper (set_privileges_to_user(), with an EffectiveUserInfo carrier using g_auto cleanup) drops the effective GID and UID to the target user — initgroups + setegid + seteuid, in that order — before any filesystem I/O on ~/.ssh, and restores them automatically on every exit path through the auto-cleanup, so the early-return paths in remove/get cannot leave the daemon running as the wrong user. The restore asserts success (seteuid/setegid back to root), aborting — and letting the service manager restart the agent — if it ever failed. With the effective identity dropped before the I/O, both variants fail closed: the create hits EACCES and the chown hits EPERM as the unprivileged user. The fix was merged upstream and backported to the stable branches 10.0.14, 11.0.5 and 11.1.2.

Impact and honest preconditions

  • Elevation of privilege from an unprivileged local user inside the guest to root inside the same guest.
  • Conditional on the guest-ssh-add-authorized-keys command being invoked for the victim's account by the host/operator (the normal use of the command). The unprivileged user only pre-stages the symlink in a home they already control; they do not trigger the command themselves. This is the operator/host-trusted trigger model, reflected in the CVSS UI:R, and it is stated explicitly rather than rated as self-triggered. The upstream maintainers were appropriately cautious about real-world exploitability for exactly this reason; the precondition is not overstated here.

Disclosure timeline

DateEvent
2026-06-07Reported to [email protected], with both variants reproduced end to end on qga 6.2.0
2026-06-12CVE-2026-12080 assigned by Red Hat Product Security; the qga maintainer confirmed the issue
2026-07-20CVE-2026-12080 published
2026-09Fix merged upstream and backported to stable 10.0.14 / 11.0.5 / 11.1.2

License

MIT. See LICENSE.

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    593
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    371
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    336
  • 5

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    326
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    322

Explore all tools

Browse our collection of tools

View all tools →