https://github.com/vitejs/vite/security/advisories/GHSA-p4f5-76q4-ffq7
Vulnerability details: ( https://cloud.tencent.com.cn/announce/detail/2583 )
Vite is a blazing-fast frontend build tool based on native ES modules, with instant startup, on-demand compilation and HMR, designed for modern frontend frameworks (Vue, React, etc.).
In affected versions of the Vite dev server, the resolver plugin's __vite-browser-external: and __vite-optional-peer-dep: virtual modules embed module IDs derived from URLs without escaping them, and some of those values can be arbitrary. This lets an attacker inject arbitrary code into those virtual modules. And since Vite trusts module code by default, two things follow: files referenced by the virtual module can bypass the server.fs allow-list check (e.g. injecting import '/@fs/tmp/decoy-secret.txt' reads sensitive files outside the project), and when Vite handles new Worker and import.meta.glob it uses eval to extract values from module code, which the attacker can abuse to make Vite execute the injected code on the server side, bypassing restrictions on exports, require and similar via globalThis.process.getBuiltinModule and other routes — ultimately achieving arbitrary code execution when the Vite dev server is exposed to the network.
Note: for a successful exploit, the target app must explicitly expose the Vite dev server to the network (via the --host flag or the server.host config option).
https://github.com/vitejs/vite/security/advisories/GHSA-p4f5-76q4-ffq7
漏洞详情:( https://cloud.tencent.com.cn/announce/detail/2583 )
Vite 是一个基于原生 ES 模块的极速前端构建工具,支持快速启动、按需编译和热更新,专为现代前端框架(如 Vue、React)设计。
在 Vite 开发服务器的受影响版本中,由于其 resolver 插件提供的 __vite-browser-external: 与 __vite-optional-peer-dep: 虚拟模块在嵌入由 URL 派生的模块 ID 时未进行转义,而部分可为任意值,导致攻击者能够在该虚拟模块中注入任意代码;又由于 Vite 默认信任模块代码,一方面被虚拟模块引用的文件可绕过 server.fs 的允许列表检查(如注入 import '/@fs/tmp/decoy-secret.txt' 即可读取项目外的敏感文件),另一方面 Vite 在处理 new Worker 与 import.meta.glob 时会使用 eval 提取模块代码中的值,攻击者可借此让 Vite 在服务端执行注入的代码,并通过 globalThis.process.getBuiltinModule 等方式绕过对 exports、require 等变量的限制,最终在 Vite 开发服务器暴露于网络时实现任意代码执行。
注:攻击者要成功利用该漏洞,目标应用必须显式将 Vite 开发服务器暴露于网络(使用 --host 参数或 server.host 配置项)。
Translated by AI from 简体中文Original (简体中文)
可以共享、可以push的免费邮箱,更可使用自定义域名,完美契合您的各项需求。
3 replies
Sort order