当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2016-0170571

漏洞标题:微软某PC端软件二进制代码劫持漏洞

相关厂商:微软

漏洞作者: MITM

提交时间:2016-01-17 14:56

修复时间:2016-04-11 16:08

公开时间:2016-04-11 16:08

漏洞类型:远程代码执行

危害等级:高

自评Rank:17

漏洞状态:已交由第三方合作机构(cncert国家互联网应急中心)处理

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2016-01-17: 细节已通知厂商并且等待厂商处理中
2016-01-21: 厂商已经确认,细节仅向厂商公开
2016-01-24: 细节向第三方安全合作伙伴开放(绿盟科技唐朝安全巡航无声信息
2016-03-16: 细节向核心白帽子及相关领域专家公开
2016-03-26: 细节向普通白帽子公开
2016-04-05: 细节向实习白帽子公开
2016-04-11: 细节向公众公开

简要描述:

微软某PC端软件二进制代码劫持漏洞。

详细说明:

Visual Studio Code Version 0.10.6存在DLL和EXE劫持漏洞。当使用Code打开文件(比如test.md)时,当前目录(current directory)为test.md所在目录。
Code在启动时尝试运行REG.exe(reg query HKLM\Software\Microsoft\SQMClient /v MachineId),而且没有指定全路径,导致REG.exe可以从当前目录加载[1]。如果攻击者把test.md和reg.exe一起发给用户(比如做成压缩包),那么当用户打开test.md时,reg.exe也会执行。
另外Code还加载了一些不存在的DLL:CSUNSAPI.dll, swift.dll, nfhwcrhk.dll, SureWareHook.dll, aep.dll, atasi.dll, nuronssl.dll, ubsec.dll。这些DLL不存在于应用目录以及系统目录,这导致它们一样可以从当前目录加载。
下载地址:https://**.**.**.**/Docs/?dv=win
[1] 加载exe和加载dll的寻找顺序不一样。加载exe的顺序是:应用目录>当前目录>系统目录>PATH,加载dll的默认顺序是:应用目录>系统目录>当前目录>PATH。这导致即使系统目录中存在该exe,仍可以劫持该exe。
https://**.**.**.**/en-us/library/windows/desktop/ms682425(v=vs.85).aspx
https://**.**.**.**/en-us/library/windows/desktop/ff919712(v=vs.85).aspx
英文版:
Visual Studio Code Version 0.10.6 is vulnerable to DLL and EXE planting attacks.
Product: Visual Studio Code
Version: 0.10.6
Download URL: https://**.**.**.**/Docs/?dv=win
Type of vulnerability: Remote Code Execution
Detail:
VS Code doesn't set its current directory to the application directory. So, when a file (taking test.md as an example) is opened with Code, the current directory is where test.md resides. During initialization, Code launches reg.exe without specifying the full path (reg query HKLM\Software\Microsoft\SQMClient /v MachineId), so reg.exe can be loaded from the current directory, which can be controlled by an attacker if he distributes a zip file containing test.md and a malicious reg.exe.
Also Code loads CSUNSAPI.dll, swift.dll, nfhwcrhk.dll, SureWareHook.dll, aep.dll, atasi.dll, nuronssl.dll, ubsec.dll. These DLLs exist neither in the application directory nor in the system directories. So they can be loaded from the current directory as well.
To fix this vulnerability, set the current directory to the application directory. Alternatively, specify the full path of reg.exe (or use Registry APIs to query values) and call SetDllDirectory("").

漏洞证明:

打开Process Explorer,筛选Code.exe进程、NAME NOT FOUND结果,就可以发现这个漏洞:

version

dll

reg.exe

REG code run.png

修复方案:

使用全地址,调用SetDllDirectory(""),把当前地址设置为应用地址。

版权声明:转载请注明来源 MITM@乌云


漏洞回应

厂商回应:

危害等级:中

漏洞Rank:7

确认时间:2016-01-21 13:47

厂商回复:

最新状态:

暂无