CriticalCVE-2025-31125

    Vite has a `server.fs.deny` bypassed for `inline` and `raw` with `?import` query (CVE-2025-31125)

    Published In CISA KEV since Sources: CVE.org, OSV

    What is affected, what to do

    Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?raw?import.

    The vulnerability is being actively exploited; treat it as a priority. Update Vitejs to version 4.5.11. Immediate actions, mitigation and detection rules are in the runbook below.

    Affected
    • Vitejs gte 5.0.0, < 5.4.16..*
    • Vitejs lt *..4.5.11
    Fixed in
    • Vitejs 4.5.11

    Not sure whether and how you are affected? Ask a question about this vulnerability

    Metrics

    7.5

    Priority

    XIEM Effective CVSS: highest available CVSS rating from NVD and vendor data.

    Source: NVD, CVSS v3

    5.3

    CVSS v3

    Severity Medium on the scale from 0 to 10.

    Source: CVE.org, OSV

    74.9 %

    EPSS score

    High — model estimates ≥ 50% chance of real-world exploitation within 30 days.

    Source: FIRST EPSS, percentile 99.50

    Show all metrics
    Severity
    Critical
    Priority (0–325)

    The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?

    Read in glossary
    214.09 Methodology
    Exploit maturity

    An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.

    Read in glossary
    actively exploitedSource: VulnCheck KEV (opens in a new tab) How we classify
    XIEM Effective CVSS

    XIEM® is the tiered managed-security operating model from NEOSEC and a registered trademark of NEOSEC GmbH. It extends classic SIEM — the central collection, normalisation and correlation of security-relevant events — with endpoint forensics, network visibility and deception technology, and consolidates them into three building tiers: Sentry, Orchestrate and Command.

    Read in glossary
    7.5 Methodology
    CVSS v3

    CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.

    Read in glossary
    5.3
    EPSS score

    The EPSS score is the absolute model output for an individual vulnerability: the estimated probability of real-world exploitation within the next 30 days, expressed as a value between 0 and 1 (i.e. 0 % to 100 %). A score of 0.42 means „the model estimates a 42 % chance of real-world exploitation within 30 days“.

    Read in glossary
    74.9 %
    High — model estimates ≥ 50% chance of real-world exploitation within 30 days.
    EPSS percentile

    The EPSS percentile is the relative position of a vulnerability within all EPSS-scored CVEs, expressed as a value between 0 and 1. A percentile of 0.90 means „this CVE has a higher EPSS score than 90 % of all other scored CVEs“. Unlike the EPSS score, it is not a probability — but a positioning within a ranking.

    Read in glossary
    99.50
    Critical — this CVE ranks in the top fifth of all CVEs scored today (rank ≥ 80%).
    KEV status

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    Actively exploited
    Published
    In CISA KEV since

    The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.

    Read in glossary
    CISA assessment (SSVC)
    Exploitation: active · not automatable · Technical impact: total
    Source: CISA Vulnrichment, as of 23 January 2026
    CWE

    CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.

    Read in glossary
    CWE-200, CWE-284

    Response and mitigation

    Why act now?

    Prioritisation rationale

    This CVE sits on KEV because an active --host binding turns the Vite dev server into an unauthenticated file-read endpoint reachable with a single HTTP GET — enough to pull .env files containing production secrets. EPSS places it among the most likely CVEs to be exploited this cycle because mass scanners trivially fingerprint port 5173 and the payload is a plain query string. CISA has not flagged ransomware use; the realistic risk is credential theft and supply-chain pivot from a compromised dev environment into production pipelines. Prioritise proportionally to the number of Vite instances exposed in CI, cloud dev environments, and preview deployments — localhost-only developer workstations are a lower tier.

    1. Runbook step 1

      Immediate response (0-24 h)

      • Upgrade Vite to a fixed release: 6.2.4, 6.1.3, 6.0.13, 5.4.16, or 4.5.11. In monorepos run npm ls vite / pnpm why vite / yarn why vite to catch transitive pulls through Nuxt, SvelteKit, Astro, Storybook, Remix, or Vitest, then regenerate package-lock.json / pnpm-lock.yaml.
      • Take exposed dev servers off the network immediately. Audit every vite.config.{js,ts,mjs} for server.host and every launch script for --host / --host 0.0.0.0. Only instances actively binding to external interfaces are vulnerable; the default localhost binding is safe.
      • Inspect CI/CD runners, preview environments, dev containers, and cloud IDEs (Codespaces, Gitpod, Coder) for Vite dev servers listening on 0.0.0.0:5173 or alternative ports; flip them to server.host: false or drop the --host flag.
      • Validate perimeter and cloud security groups: TCP 5173 (default), 4173 (preview), and 24678 (HMR) must not be reachable from the internet. Where a reverse proxy fronts dev environments, add path filtering for ?raw and ?inline query parameters.
      • Rotate secrets. If an exposed dev server was reachable, assume .env, .env.local, config files, keystores, and private keys inside the project tree have been read. Rotate API tokens, database credentials, and signing keys.
    2. Runbook step 2

      Mitigation layers

      • Network segmentation: Vite dev servers do not belong in production or DMZ segments. Isolate developer VLANs from the internet via ACLs; for remote development mandate access through VPN or a zero-trust proxy (Teleport, Cloudflare Access, Tailscale) with authentication.
      • Configuration hardening: enforce server.host: 'localhost' (or false) plus server.fs.strict: true in every vite.config.*. Scope server.fs.allow to the project root and explicitly block parent-directory escapes via server.fs.deny.
      • WAF / reverse-proxy rule: where nginx, Traefik, or Envoy fronts a dev or preview environment, block or 403 requests whose query string matches ?raw, ?import, ?inline&import, ?raw?import. Snort/Suricata rule on HTTP URI regex \?(raw|inline)(&|\?)import.
      • Endpoint hardening: constrain developer workstation host firewalls (Windows Firewall, nftables, Little Snitch) so inbound connections to 5173, 4173, 24678 are only accepted from 127.0.0.1.
      • SBOM / dependency governance: track Vite and Vite-based meta-frameworks (Nuxt 3, SvelteKit, Astro, Remix-Vite, Vitest) in Dependabot/Renovate with auto-merge for minor and patch upgrades. Add an SCA tool (Trivy, Snyk, OWASP Dependency-Check) to pre-merge pipelines.
      • Least privilege for secrets: no production secrets in repo roots. Keep .env.production in a secrets manager (Vault, AWS Secrets Manager, Azure Key Vault) and inject at build/deploy time only.
    3. Runbook step 3

      Detection rules

      • Web / reverse-proxy access logs: regex the URI for \?(raw|inline)(\?|&)import or [?&]raw(&|$) combined with HTTP 200 and response size > 1 KB. KQL shape: WebLogs | where UriQuery matches regex @"(raw|inline).*import" | where StatusCode == 200.
      • Sysmon / EDR process ancestry: node.exe or node spawning vite with network exposure. Sigma shape: ParentImage endswith '\node.exe' AND CommandLine contains 'vite' AND (CommandLine contains '--host' OR CommandLine contains '0.0.0.0').
      • Netflow / Zeek: inbound TCP sessions to developer subnets on 5173, 4173, 24678 originating from untrusted ranges. Zeek filter: conn.log | id.resp_p in {5173,4173,24678} AND id.orig_h !in LOCAL_NETS.
      • File-access telemetry (auditd / Sysmon EID 11): the Node process reading .env*, *.pem, id_rsa*, *.kdbx outside the project root during an active Vite session.
      • CI/CD audit: GitHub Actions or GitLab CI jobs invoking vite preview --host or vite dev --host without network isolation — enforce via policy-as-code (OPA, Checkov) pipeline linting.

    Detection rules

    No NEOSEC detection rule is available for this vulnerability yet.

    Classification under NIS2 and CRA

    Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.

    NIS2

    NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.

    Read in glossary
    Actively exploited: treat the vulnerability as a priority in vulnerability handling under Art. 21(2)(e) NIS2. If it is exploited in your environment, check the reporting obligation under Art. 23 (early warning within 24 hours).
    CRA

    The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.

    Read in glossary
    Since 11.09.2026, manufacturers of affected products with digital elements must report actively exploited vulnerabilities under Art. 14 CRA, with an early warning within 24 hours via ENISA's single reporting platform.
    ISO/IEC 27001

    ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.

    Read in glossary
    Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.

    Description

    Vite is a frontend tooling framework for javascript. Vite exposes content of non-allowed files using ?inline&import or ?raw?import. Only apps explicitly exposing the Vite dev server to the network (using --host or server.host config option) are affected. This vulnerability is fixed in 6.2.4, 6.1.3, 6.0.13, 5.4.16, and 4.5.11.

    Source: NVD (NIST), OSV (Open Source Vulnerabilities), CISA KEV Catalog, CVE.org (MITRE), cvelistv5

    Affected products

    The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.

    Affected products
    Affected versionsFixed in
    vitejsvite
    • ≥ 5.0.0, < 5.4.16
    • < 4.5.11
    • 6.1.0 – < 6.1.3
    • 6.0.0 – < 6.0.13
    • < 4.5.11
    • 6.2.0 – < 6.2.4
    • 5.0.0 – < 5.4.16
    • —
    • 4.5.11
    • 6.1.3
    • 6.0.13
    • 4.5.11
    • 6.2.4
    • 5.4.16
    npmvite
    • 6.0.0
    • 5.0.0
    • 6.1.0
    • 6.2.0
    • —
    • —
    • —
    • —
    • —
    • —

    Vendors and products

    Weakness classes (CWE)

    • CWE-200Exposure of Sensitive Information to an Unauthorized Actor

      Class

      The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.

      Entry at MITRE CWE-200
    • CWE-284Improper Access Control

      Pillar

      The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.

      Entry at MITRE CWE-284

    Public exploit references

    Publicly reported proof-of-concepts, exploit modules and detection templates for this vulnerability. NEOSEC links to the original sources only and does not provide any exploit code.

    Public exploit references
    CISA KEV CatalogCISA Known Exploited Vulnerability (opens in a new tab)cisa.govactively exploited
    Reference tagged as exploitgithub.com (opens in a new tab)PoC (publicly reported)reported, not verified—

    References & sources

    • github.comvitejs/vite/security/advisories/GHSA-4r4m-qw57-chr8web, x_refsource_CONFIRM, Exploit, Vendor advisory
    • NVD (NIST)vuln/detail/CVE-2025-31125advisory
    • github.comvitejs/vite/commit/59673137c45ac2bcfad1170d954347c1a17ab949web, x_refsource_MISC, Patch
    • github.comvitejs/vitepackage
    • cisa.govknown-exploited-vulnerabilities-catalog?field_cve=CVE-2025-31125web, government-resource, US government resource

    Linked advisories

    Embed badge

    Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.

    Badge preview for CVE-2025-31125
    <a href="https://intel.neosec.eu/en/cve/CVE-2025-31125"><img src="https://intel.neosec.eu/badge/cve/CVE-2025-31125.svg?lang=en" alt="CVE-2025-31125 – NEOSEC Intel" height="20"></a>