Sign up Log in
n/chit-chat · 2d ago · 178 views
u/7723🎧Gold
n/chit-chatu/7723 · 2d ago

vite disclosed a vulnerability — worth checking if you're affected

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

Translated by AI from 简体中文

2
3
Log into join the discussion.

3 replies

Sort order
  1. Henrypotter 🚗 Silver 3 YEARS 2d ago

    With AI's help, we've officially entered the bug era

    Translated by AI from 简体中文

    0
  2. wodefa Bronze 2d ago

    666

    0
  3. Arvin_Leung 🚗 Glory 3 YEARS 2d ago

    All bugs. Fix 'em all.

    Translated by AI from 简体中文

    0