Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/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.

查看仓库
29天前尚未审核
内容在请求的语言中不可用。显示英文版本。

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.

下载工具

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    1.0k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    593
  • 3

    looking-glass

    anonghosty/looking-glass

    CSIRT 平台,可将 Shadowserver 报告导入 MongoDB,并将其重放为交互式地图、分析、发现、公告和高管仪表板。

    381
  • 4

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    321
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    AI原生网络安全的行动系统——在这里,意图转化为受治理的执行,证据沉淀为运营记忆,每一次操作都让下一次更出色。

    316
  • 6

    redforge

    cybersecurity91/redforge

    浏览器端红队工具包,包含 102 个离线工具,用于侦察、载荷生成、凭据攻击、加密、编码和交战报告。

    305

探索所有工具

浏览我们的工具集合

查看所有工具 →