CVE-2025-31125 Microsoft Sentinel · KQL

Detect CVE-2025-31125: Vite Dev Server Improper Access Control in Microsoft Sentinel

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

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
union DeviceNetworkEvents, DeviceFileEvents, W3CIISLog
| where TimeGenerated > ago(7d)
| where (
    (csUriStem contains "/@fs/" and (csUriStem contains ".." or csUriStem contains "%2e%2e" or csUriStem contains "/etc/" or csUriStem contains "/proc/" or csUriStem contains "/.env" or csUriStem contains "/passwd"))
    or (csUriStem contains "/__vite_ping" and csMethod =~ "GET")
    or (csUriStem matches regex @"/@fs/[a-zA-Z]:[\\/]" )
    or (csUriStem contains "/@fs/" and csUriStem !startswith "/@fs/" + csUriStem)
)
| extend SuspiciousPath = csUriStem, ClientIP = cIP, RequestMethod = csMethod
| project TimeGenerated, SuspiciousPath, ClientIP, RequestMethod, csHost, scStatus, csUserAgent
| order by TimeGenerated desc
high severity medium confidence

Detects HTTP requests to Vite dev server endpoints that attempt path traversal or unauthorized file system access via the /@fs/ route, which is characteristic of CVE-2025-31125 exploitation.

Data Sources

IIS LogsWeb Application Firewall LogsAzure Application GatewayNetwork Proxy Logs

Required Tables

W3CIISLogDeviceNetworkEventsAzureDiagnostics

False Positives & Tuning

  • Legitimate Vite dev server usage with /@fs/ paths for valid module resolution during development
  • Security scanners and vulnerability assessment tools probing for the vulnerability
  • Developers testing path resolution in non-production Vite environments
  • Automated CI/CD pipelines that access Vite dev server during build processes

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.

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

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

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections