Zapscape (CVE-2026-64561)
Zapscape (CVE-2026-64561)

原始链接: https://github.com/V4bel/Zapscape

**Zapscape (CVE-2026-64561)** 是由 Hyunwoo Kim (@v4bel) 发现的一个关键 KVM/x86 逃逸漏洞。该缺陷存在于 Linux 内核的影子 MMU 模拟中,具体位于影子页面回收期间触发的递归清除路径内。 通过执行客户机端操作,拥有虚拟机内部 root 权限的攻击者可以触发释放后使用 (UAF) 条件。这使攻击者能够破坏宿主机内核的影子页面,从而实现从客户机到宿主机的逃逸。成功利用该漏洞可使攻击者在宿主机上获得 root 级执行权限,对多租户公共云环境以及其他使用嵌套虚拟化的系统构成威胁。 该漏洞影响 2020 年中期至 2026 年 7 月之间的 Linux 内核版本。虽然提供的概念验证 (PoC) 针对的是 AMD 环境,但该问题存在于内核 KVM 栈中,这意味着它独立于 QEMU 存在。除了云逃逸外,该漏洞还可以在 `/dev/kvm` 对所有用户可写的系统上作为本地权限提升 (LPE) 使用。 研究人员强调,此漏洞与之前发现的“Januscape”漏洞不同。敦促用户和管理员优先修补其宿主机虚拟机监控程序,以降低这些风险。

Hacker News 上的一场讨论重点关注了名为“Zapscape”(CVE-2026-64561) 的新发现,这是一个影响虚拟机的严重漏洞。评论者指出,该缺陷的波及范围似乎比以往涉及嵌套页表的问题更广。 讨论很快转向了对云服务提供商的实际影响。用户们探讨了平台如何在不造成重大服务中断的情况下管理安全补丁,并讨论了诸如在线迁移等技术。尽管基础虚拟机可以无缝迁移,但参与者指出,专用硬件(如 GPU 或低延迟组件)使该过程变得复杂,通常需要基于 Kubernetes 的集群管理来清空节点并启动替代节点。 尽管该漏洞在技术上非常严重,但一些参与者表示,这类关键漏洞往往未能获得更广泛科技界应有的重视,对此感到沮丧。
相关文章

原文

tux

demo

This document describes the Zapscape (CVE-2026-64561) vulnerability discovered and reported by Hyunwoo Kim (@v4bel). It is a KVM escape vulnerability that lets a guest escape to the host in a KVM/x86 environment and run commands on the host with kernel (root) privilege.

Zapscape is a use-after-free vulnerability in the shadow MMU emulation of KVM/x86, specifically in the recursive zap path that runs when shadow pages are reclaimed. It can trigger the bug with guest-side actions alone to corrupt the host kernel's shadow page, and it can threaten the guest-host isolation of KVM/x86 hosts that accept untrusted guests and expose nested virtualization, particularly multi-tenant x86 public clouds.

For the detailed technical information, see here.

Note

After reporting this vulnerability to [email protected], the agreed embargo has ended, so the exploit is posted to oss-security and this Zapscape document is published. For the disclosure timeline, see the technical detail document.

The PoC is written to target AMD, and for safe testing, running it under QEMU TCG is recommended. The PoC has the following structure.

L0: Linux 7.1.3 + KVM_AMD on an x86_64 CPU (AMD SVM/NPT) emulated by QEMU TCG. The escape target
  └─ L1: the guest poc creates. Switching long -> PAE aliases one shadow page as both child and pinned root, and L1 then escalates the UAF into L0 kernel code-exec
       └─ L2: the guest L1 VMRUNs. Its memory touches trigger L0's quota reclaim -> recursive zap with no root_count guard -> UAF

This PoC is not a weaponized exploit that runs immediately in a cloud environment, but demonstration code that reproduces the vulnerability and the full exploit chain on top of QEMU TCG. To use it in a real cloud environment, the L1 actions the PoC performs must be moved into a guest kernel module, and the exploit must be ported to match the host kernel's kconfig. This is not a difficult task.

  1. Download the vulnerable v7.1.3 kernel source, then build the kernel image based on the bundled kconfig.
  2. Build the PoC, then compose a suitable initramfs using BusyBox or the like and put the built PoC into the initramfs.
# gcc -O2 -g -static -pthread poc.c -o poc
  1. Boot the Linux 7.1.3 target with the following command. Test on QEMU v9.2.0 or later.
# ./qemu.sh bzImage initramfs.cpio.gz
  1. After QEMU TCG boots, run the PoC. On a successful exploit, it escapes the guest and creates the /Zapscape file owned by root on the host.
 /$$$$$$$$  /$$$$$$  /$$$$$$$
|_____ $$  /$$__  $$| $$__  $$
     /$$/ | $$  \ $$| $$  \ $$
    /$$/  | $$$$$$$$| $$$$$$$/
   /$$/   | $$__  $$| $$____/
  /$$/    | $$  | $$| $$
 /$$$$$$$$| $$  | $$| $$
|________/|__/  |__/|__/

[+] /Zapscape created by the target KVM host kernel (owner uid=0, mode=0644).
[+] exploit completed - verify with: ls -la /Zapscape
zapscape(uid=65534)$ ls -la /Zapscape
-rw-r--r--    1 root     root             0 Jul 29 05:27 /Zapscape
zapscape(uid=65534)$

This PoC is intended to provide accurate information. Do not use it on systems you are not authorized to test.

Zapscape (CVE-2026-64561) covers the range from f95eec9bed76 (2020-07-08) to 2abd5287f083 (2026-07-21).

What is the impact of this vulnerability?

The same as Januscape (CVE-2026-53359):

  1. KVM escape: With guest-side actions alone, an attacker can compromise the host that runs their VM. For example, an attacker who has rented just a single instance on a public cloud could panic the host kernel to take down every other tenant VM on the same physical machine (DoS), or run code with root privilege on the host to take over the host and all the guests on it (RCE).
  2. LPE: On distributions such as RHEL, /dev/kvm is world-writable (0666), so an unprivileged user can also use this vulnerability as an LPE to gain root. When it is used as an LPE, host-side VMM ioctls are available, so the exploit becomes easier and more stable.

How is this related to Januscape?

It occurs in the same shadow MMU, but it is a separate vulnerability with a different root cause.

That said, unlike Januscape, on Intel it can be triggered only when both EPT page walk length 4 and 5 are exposed to L1. This is an important point when assessing the affected scope, so it must be understood precisely. See the technical detail document.

Does this vulnerability occur in QEMU?

No. As with Januscape, it occurs in in-kernel KVM, so it is triggered independently of QEMU's emulation. Because of this, it can also threaten large public clouds that implement and use their own virtualization stack.

Do I need root inside the guest VM?

Yes. L1 kernel privilege is required. When you are allocated an instance on a public cloud, you usually have root on your own VM, so this is satisfied. In a scenario without guest root, it must be chained with an LPE such as Dirty Frag.

Do you think KVM vulnerabilities will keep appearing?

Yes. I recommend establishing a sustainable patching process for host hypervisors. Winter is coming.

Are you planning a sequel after the trilogy?

I hope not.

联系我们 contact @ memedata.com