Skip to content
Heist/ feed
Back to feed
Medium

Vitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect Mock

Type: advisorySources: OSV

Vitest is a testing framework powered by Vite. From 2.1.0 until 4.1.11 and 5.0.0-rc.2, the public mockerPlugin and standalone interceptorPlugin exports in packages/mocker/src/node/interceptorPlugin.ts register the vitest:interceptor:register handler on Vite's unauthenticated HMR WebSocket without validating redirect targets against the file-serving allowlist. The implementation processes event.redirect without enforcing server.fs.allow and server.fs.deny through isFileLoadingAllowed. A remote client that can reach an exposed development server can submit an opaque URL scheme preserving .. segments, causing join(server.config.root, redirectUrl.pathname) to resolve outside the project root. The plugin's load hook then returns readFile(mock.redirect, 'utf-8') as module source, disclosing local files readable by the dev-server process. Vitest browser mode uses a token-authenticated RPC and is not remotely unauthenticated by default, although the same boundary check was missing on that path. This issue is fixed in versions 4.1.11 and 5.0.0-rc.2.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-84373
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 11:02 UTC · Revision 1

Source evidence

Vitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect Mock

core-osv · Original source

Published 1 Sept 2026, 21:26 UTC

Vitest is a testing framework powered by Vite. From 2.1.0 until 4.1.11 and 5.0.0-rc.2, the public mockerPlugin and standalone interceptorPlugin exports in packages/mocker/src/node/interceptorPlugin.ts register the vitest:interceptor:register handler on Vite's unauthenticated HMR WebSocket without validating redirect targets against the file-serving allowlist. The implementation processes event.redirect without enforcing server.fs.allow and server.fs.deny through isFileLoadingAllowed. A remote client that can reach an exposed development server can submit an opaque URL scheme preserving .. segments, causing join(server.config.root, redirectUrl.pathname) to resolve outside the project root. The plugin's load hook then returns readFile(mock.redirect, 'utf-8') as module source, disclosing local files readable by the dev-server process. Vitest browser mode uses a token-authenticated RPC and is not remotely unauthenticated by default, although the same boundary check was missing on that path. This issue is fixed in versions 4.1.11 and 5.0.0-rc.2.

osv:CVE-2026-84373
Complete source record
{
  "id": "137879c3b432d9bd4afad937b6ee6bf6001de263e146dfa20cd800068d5f3d57",
  "url": "https://osv.dev/vulnerability/CVE-2026-84373",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Vitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect Mock",
    "summary": "Vitest is a testing framework powered by Vite. From 2.1.0 until 4.1.11 and 5.0.0-rc.2, the public mockerPlugin and standalone interceptorPlugin exports in packages/mocker/src/node/interceptorPlugin.ts register the vitest:interceptor:register handler on Vite's unauthenticated HMR WebSocket without validating redirect targets against the file-serving allowlist. The implementation processes event.redirect without enforcing server.fs.allow and server.fs.deny through isFileLoadingAllowed. A remote client that can reach an exposed development server can submit an opaque URL scheme preserving .. segments, causing join(server.config.root, redirectUrl.pathname) to resolve outside the project root. The plugin's load hook then returns readFile(mock.redirect, 'utf-8') as module source, disclosing local files readable by the dev-server process. Vitest browser mode uses a token-authenticated RPC and is not remotely unauthenticated by default, although the same boundary check was missing on that path. This issue is fixed in versions 4.1.11 and 5.0.0-rc.2.",
    "evidence": "osv:CVE-2026-84373",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-84373",
      "aliases": [
        "CVE-2026-84373",
        "GHSA-82fw-gwwq-j7x9"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/vitest-dev/vitest",
              "type": "GIT",
              "events": [
                {
                  "introduced": "9f1fd182fd96931ee876662f75e5931031798299"
                },
                {
                  "fixed": "9bd8d464e6328c567c2dbcd8fdd977d57a9425c2"
                },
                {
                  "introduced": "e3cb192817dcca799573c3bf993dd0cacb9a9392"
                },
                {
                  "fixed": "af83d1b1933b5d74c421d30849717369b828de0b"
                },
                {
                  "fixed": "51edf2b072902aec6d30c90ebaafd8f121c6f9d8"
                },
                {
                  "fixed": "8ff9b9a9efca7c6cfd5243569440de8d7a33aec4"
                },
                {
                  "fixed": "fe5a11d3ceac5ec10d6d7d21a46d4caca132c48f"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "2.1.0"
                      },
                      {
                        "fixed": "4.1.11"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "introduced": "5.0.0-beta.1"
                      },
                      {
                        "fixed": "5.0.0-rc.2"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "51edf2b072902aec6d30c90ebaafd8f121c6f9d8"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "8ff9b9a9efca7c6cfd5243569440de8d7a33aec4"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "fe5a11d3ceac5ec10d6d7d21a46d4caca132c48f"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "9bd8d464e6328c567c2dbcd8fdd977d57a9425c2"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v4.1.11"
                  },
                  {
                    "range": [
                      {
                        "fixed": "af83d1b1933b5d74c421d30849717369b828de0b"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v5.0.0-rc.2"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v5.0.0-rc.1",
            "v5.0.0-beta.7",
            "v4.1.10",
            "v5.0.0-beta.6",
            "v4.1.9",
            "v5.0.0-beta.5",
            "v4.1.8",
            "v5.0.0-beta.4",
            "v4.1.7",
            "v4.1.6",
            "v5.0.0-beta.3",
            "v5.0.0-beta.2",
            "v4.1.5",
            "v5.0.0-beta.1",
            "v4.1.4",
            "v4.1.3",
            "v4.1.2",
            "v4.1.1",
            "v4.1.0",
            "v4.1.0-beta.6",
            "v4.1.0-beta.5",
            "v4.1.0-beta.4",
            "v4.1.0-beta.3",
            "v4.0.17",
            "v4.1.0-beta.2",
            "v4.1.0-beta.1",
            "v4.0.16",
            "v4.0.15",
            "v4.0.14",
            "v4.0.13",
            "v4.0.12",
            "v4.0.11",
            "v4.0.10",
            "v4.0.9",
            "v4.0.8",
            "v4.0.7",
            "v4.0.6",
            "v4.0.5",
            "v4.0.4",
            "v4.0.3",
            "v4.0.2",
            "v4.0.1",
            "v4.0.0",
            "v4.0.0-beta.19",
            "v4.0.0-beta.18",
            "v4.0.0-beta.17",
            "v4.0.0-beta.16",
            "v4.0.0-beta.15",
            "v4.0.0-beta.14",
            "v4.0.0-beta.13",
            "v3.2.4",
            "v4.0.0-beta.12",
            "v4.0.0-beta.11",
            "v4.0.0-beta.10",
            "v4.0.0-beta.9",
            "v4.0.0-beta.8",
            "v4.0.0-beta.7",
            "v4.0.0-beta.6",
            "v4.0.0-beta.5",
            "v4.0.0-beta.4",
            "v4.0.0-beta.3",
            "v4.0.0-beta.2",
            "v4.0.0-beta.1",
            "v3.2.3",
            "v3.2.2",
            "v3.2.1",
            "v3.2.0",
            "v3.2.0-beta.3",
            "v3.1.3",
            "v3.2.0-beta.2",
            "v3.2.0-beta.1",
            "v3.1.2",
            "v3.1.1",
            "v3.1.0",
            "v3.1.0-beta.2",
            "v3.1.0-beta.1",
            "v3.0.9",
            "v3.0.8",
            "v3.0.7",
            "v3.0.6",
            "v3.0.5",
            "v3.0.4",
            "v3.0.3",
            "v3.0.2",
            "v3.0.1",
            "v3.0.0",
            "v3.0.0-beta.4",
            "v3.0.0-beta.3",
            "v3.0.0-beta.2",
            "v3.0.0-beta.1",
            "v2.1.5",
            "v2.2.0-beta.2",
            "v2.2.0-beta.1",
            "v2.1.4",
            "v2.1.3",
            "v2.1.2",
            "v2.1.1",
            "v2.1.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-84373.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:28.208036909Z",
      "provider": "osv",
      "references": [
        "https://github.com/vitest-dev/vitest/releases/tag/v4.1.11",
        "https://github.com/vitest-dev/vitest/releases/tag/v5.0.0-rc.2",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/84xxx/CVE-2026-84373.json",
        "https://github.com/vitest-dev/vitest/security/advisories/GHSA-82fw-gwwq-j7x9",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-84373",
        "https://github.com/vitest-dev/vitest/commit/51edf2b072902aec6d30c90ebaafd8f121c6f9d8",
        "https://github.com/vitest-dev/vitest/commit/8ff9b9a9efca7c6cfd5243569440de8d7a33aec4",
        "https://github.com/vitest-dev/vitest/commit/fe5a11d3ceac5ec10d6d7d21a46d4caca132c48f",
        "https://github.com/vitest-dev/vitest/pull/10972",
        "https://github.com/vitest-dev/vitest/pull/10974"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-22"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/84xxx/CVE-2026-84373.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-84373",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 494825,
  "published_at": "2026-09-01T21:26:26.11+00:00"
}