GHSA-7G9H-PV6M-P3MW
Path Traversal (Arbitrary File Read) in Qwik City Vite Dev Server Static Middleware
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Remediación | Parche 1.20.1 | @builder.io/qwik-city · -10 d desde divulgación | |
| Divulgación | Publicada | GHSA-7G9H-PV6M-P3MW divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Description
In `@builder.io/qwik-city` 1.20.0, `staticDistMiddleware` constructs filesystem paths by concatenating the request pathname with the raw query string:
const relPath = `${url.pathname.slice(1)}${url.search}`;
const filePath = join(distDir, relPath);Although the URL parser normalizes dot segments in `url.pathname`, it does not apply path normalization to `url.search`. An attacker can therefore place `../` segments in the query string, which `path.join()` interprets as traversal sequences. Because the resulting path is not checked to ensure it remains within the configured static directory, it can resolve to files elsewhere on the host filesystem.
The extension allow-list does not prevent exploitation because it is applied to the combined pathname and query string. An attacker can satisfy the check by ending the query with an allowed extension such as `.json`, `.js`, `.css`, or `.html`. If the resolved target is a regular file, the middleware returns its contents and discloses its resolved filesystem location in the `X-Source-Path` response header.
In the assessed release, this middleware is not registered during an ordinary development-mode `vite dev` run. The vulnerable route is reachable when Vite’s serve command runs in production mode, such as with `vite --mode production`, and the server is accessible to an untrusted network.
Impact
An unauthenticated remote attacker who can reach an affected server can read files outside the intended distribution, build-output, and public directories. Accessible targets are limited to files readable by the server process whose names end in an allow-listed extension, but these may include application source code, JavaScript configuration, package metadata, source maps, and JSON files containing credentials, tokens, or other sensitive data.
The `X-Source-Path` header also reveals the resolved location of successfully retrieved files, assisting further filesystem discovery. The demonstrated impact is a confidentiality breach; this issue does not establish file modification, code execution, availability impact, or exposure through a normal production deployment.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
npm@builder.io/qwik-city |
Corregida | 1.20.1 | -10 d | 1.20.4 no afectada |
1.20.1Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/QwikDev/qwik/security/advisories/GHSA-7g9h-pv6m-p3mwLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
