Detect CVE-2025-31125: Vite Dev Server Improper Access Control in Google Chronicle
Detects exploitation of CVE-2025-31125, an improper access control vulnerability in Vite (Vitejs) dev server. The vulnerability allows unauthorized access to sensitive files outside the intended serve root, classified under CWE-200 (Information Exposure) and CWE-284 (Improper Access Control). This vulnerability is listed in CISA KEV, indicating active exploitation in the wild.
MITRE ATT&CK
- Tactic
- Initial Access Discovery Collection
YARA-L Detection Query
rule cve_2025_31125_vite_path_traversal {
meta:
author = "df00tech"
description = "Detects CVE-2025-31125 Vite improper access control exploitation via /@fs/ path traversal"
severity = "HIGH"
priority = "HIGH"
cve = "CVE-2025-31125"
mitre_attack = "T1190, T1083"
events:
$req.metadata.event_type = "NETWORK_HTTP"
(
re.regex($req.network.http.request_url, `.*/@fs/.*(\.\.|\.env|/etc/|/proc/|passwd|shadow).*`) or
re.regex($req.network.http.request_url, `.*/@fs/[A-Za-z]:.*`) or
re.regex($req.network.http.request_url, `.*/@fs//(?:etc|home|root|proc|var).*`)
)
condition:
$req
} Chronicle YARA-L rule detecting HTTP requests to Vite dev server /@fs/ endpoints with path traversal patterns associated with CVE-2025-31125 exploitation.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate Vite dev server module resolution for workspace or monorepo packages
- Security tooling performing authorized vulnerability assessments
- Development environments with non-standard Vite server.fs.allow configurations
- Internal developer tooling that programmatically traverses Vite-served file trees
Other platforms for CVE-2025-31125
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Vite /@fs/ Path Traversal to Read /etc/passwd
Expected signal: HTTP GET request to /@fs/etc/passwd and variants logged in web server access logs; Node.js process accessing /etc/passwd on the file system; network connection from test host to port 5173
- Test 2Vite Dev Server Environment File Extraction
Expected signal: HTTP requests to /@fs/ with absolute paths to .env files; file system read events on .env and config files; response body containing environment variable content if successful
- Test 3Automated CVE-2025-31125 Exploitation Scan
Expected signal: Rapid sequential HTTP GET requests to /@fs/ endpoint with multiple sensitive path targets; consistent source IP across all requests; mix of 200 and 403 response codes; elevated request rate to Vite dev server port
Unlock Pro Content
Get the full detection package for CVE-2025-31125 including response playbook, investigation guide, and atomic red team tests.