uni-app icon indicating copy to clipboard operation
uni-app copied to clipboard

5.2.8 vite有重大风险 能不能升级一下

Open 17770137331 opened this issue 1 year ago • 7 comments

发行方式

None

具体平台

5.2.8 vite有重大风险 能不能升级一下

开发环境

None

项目创建方式

None

依赖版本

5.2.8 vite有重大风险 能不能升级一下

问题描述

5.2.8 vite有重大风险 能不能升级一下

重现步骤

5.2.8 vite有重大风险 能不能升级一下

期望行为

No response

实际行为

No response

截图或录屏

No response

17770137331 avatar Jun 05 '25 09:06 17770137331

5.2.8 vite有重大风险 能不能升级一下

17770137331 avatar Jun 05 '25 09:06 17770137331

5.2.8 vite有重大风险 能不能升级一下

有vite官方的声明链接吗?

chouchouji avatar Jun 05 '25 11:06 chouchouji

依赖项 npm:vite:5.2.8 vulnerable

升级到 6.3.4

CVE-2025-24010,分数: 6.5

Vite is a frontend tooling framework for javascript. Vite allowed any websites to send any requests to the development server and read the response due to default CORS settings and lack of validation on the Origin header for WebSocket connections. This vulnerability is fixed in 6.0.9, 5.4.12, and 4.5.6.

阅读更多: https://www.mend.io/vulnerability-database/CVE-2025-24010?utm_source=JetBrains

CVE-2025-32395,分数: 6.5

Vite is a frontend tooling framework for javascript. Prior to 6.2.6, 6.1.5, 6.0.15, 5.4.18, and 4.5.13, the contents of arbitrary files can be returned to the browser if the dev server is running on Node or Bun. HTTP 1.1 spec (RFC 9112) does not allow # in request-target. Although an attacker can send such a request. For those requests with an invalid request-line (it includes request-target), the spec recommends to reject them with 400 or 301. The same can be said for HTTP 2. On Node and Bun, those requests are not rejected internally and is passed to the user land. For those requests, the value of http.IncomingMessage.url contains #. Vite assumed req.url won't contain # when checking server.fs.deny, allowing those kinds of requests to bypass the check. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) and running the Vite dev server on runtimes that are not Deno (e.g. Node, Bun) are affected. This vulnerability is fixed in 6.2.6, 6.1.5, 6.0.15, 5.4.18, and 4.5.13.

阅读更多: https://www.mend.io/vulnerability-database/CVE-2025-32395?utm_source=JetBrains

CVE-2024-45812,分数: 6.4

Vite a frontend build tooling framework for javascript. Affected versions of vite were discovered to contain a DOM Clobbering vulnerability when building scripts to cjs/iife/umd output format. The DOM Clobbering gadget in the module can lead to cross-site scripting (XSS) in web pages where scriptless attacker-controlled HTML elements (e.g., an img tag with an unsanitized name attribute) are present. DOM Clobbering is a type of code-reuse attack where the attacker first embeds a piece of non-script, seemingly benign HTML markups in the webpage (e.g. through a post or comment) and leverages the gadgets (pieces of js code) living in the existing javascript code to transform it into executable code. We have identified a DOM Clobbering vulnerability in Vite bundled scripts, particularly when the scripts dynamically import other scripts from the assets folder and the developer sets the build output format to cjs, iife, or umd. In such cases, Vite replaces relative paths starting with __VITE_ASSET__ using the URL retrieved from document.currentScript. However, this implementation is vulnerable to a DOM Clobbering attack. The document.currentScript lookup can be shadowed by an attacker via the browser's named DOM tree element access mechanism. This manipulation allows an attacker to replace the intended script element with a malicious HTML element. When this happens, the src attribute of the attacker-controlled element is used as the URL for importing scripts, potentially leading to the dynamic loading of scripts from an attacker-controlled server. This vulnerability can result in cross-site scripting (XSS) attacks on websites that include Vite-bundled files (configured with an output format of cjs, iife, or umd) and allow users to inject certain scriptless HTML tags without properly sanitizing the name or id attributes. This issue has been patched in versions 5.4.6, 5.3.6, 5.2.14, 4.5.5, and 3.2.11. Users are advised to upgrade. There are no known workarounds for this vulnerability.

阅读更多: https://www.mend.io/vulnerability-database/CVE-2024-45812?utm_source=JetBrains

CVE-2025-31486,分数: 5.3

Vite is a frontend tooling framework for javascript. The contents of arbitrary files can be returned to the browser. By adding ?.svg with ?.wasm?init or with sec-fetch-dest: script header, the server.fs.deny restriction was able to bypass. This bypass is only possible if the file is smaller than build.assetsInlineLimit (default: 4kB) and when using Vite 6.0+. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 4.5.12, 5.4.17, 6.0.14, 6.1.4, and 6.2.5.

阅读更多: https://www.mend.io/vulnerability-database/CVE-2025-31486?utm_source=JetBrains

CVE-2025-31125,分数: 5.3

Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?raw?import. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 6.2.4, 6.1.3, 6.0.13, 5.4.16, and 4.5.11.

阅读更多: https://www.mend.io/vulnerability-database/CVE-2025-31125?utm_source=JetBrains

CVE-2025-30208,分数: 5.3

Vite, a provider of frontend development tooling, has a vulnerability in versions prior to 6.2.3, 6.1.2, 6.0.12, 5.4.15, and 4.5.10. @fs denies access to files outside of Vite serving allow list. Adding ?raw?? or ?import&raw?? to the URL bypasses this limitation and returns the file content if it exists. This bypass exists because trailing separators such as ? are removed in several places, but are not accounted for in query string regexes. The contents of arbitrary files can be returned to the browser. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. Versions 6.2.3, 6.1.2, 6.0.12, 5.4.15, and 4.5.10 fix the issue.

阅读更多: https://www.mend.io/vulnerability-database/CVE-2025-30208?utm_source=JetBrains

CVE-2024-45811,分数: 4.8

Vite a frontend build tooling framework for javascript. In affected versions the contents of arbitrary files can be returned to the browser. @fs denies access to files outside of Vite serving allow list. Adding ?import&raw to the URL bypasses this limitation and returns the file content if it exists. This issue has been patched in versions 5.4.6, 5.3.6, 5.2.14, 4.5.5, and 3.2.11. Users are advised to upgrade. There are no known workarounds for this vulnerability.

阅读更多: https://www.mend.io/vulnerability-database/CVE-2024-45811?utm_source=JetBrains

结果由 Mend.io 提供技术支持

liujiayii avatar Jun 12 '25 00:06 liujiayii

有最新跟进信息吗?我也需要更新

JinPengGeng avatar Aug 01 '25 08:08 JinPengGeng

+1

1014156094 avatar Nov 23 '25 08:11 1014156094

+1

ByteRax avatar Dec 15 '25 13:12 ByteRax

@chouchouji @Otto-J @yurj26

https://cn.vite.dev/releases#supported-versions

当前支持的vite版本有: 定期发布补丁 [email protected]。 重要的修复和安全补丁向后移植到 vite@7。 安全补丁也被向后移植到 [email protected]。 之前的所有版本都不再支持。用户应升级,以获得更新。

uni-app 使用的5.2.8 官方早就不再支持的版本

lujian0571 avatar Dec 22 '25 08:12 lujian0571