
Are you get Tanstack Supply chain attack attack of 5/11? CVE-2026-45321 / GHSA-g7cv-rxg3-hmpx
A security scanning tool to detect the TanStack Router CVE | TanStack Router GHSA in your projects.
This tool scans your codebase for indicators of the TanStack Router vulnerability (CVE-2026-45321 / GHSA-g7cv-rxg3-hmpx), which affects specific versions of TanStack Router packages. It detects:
router_init.js files that may contain malicious codepackage.jsonpackage-lock.json, pnpm-lock.yaml, yarn.lock)The following package versions are flagged as vulnerable:
| Package | Vulnerable Versions |
|---|---|
@tanstack/react-router | 1.169.5, 1.169.8 |
@tanstack/react-start | 1.167.68, 1.167.71 |
@tanstack/router-core | 1.169.5, 1.169.8 |
@tanstack/router-devtools-core | 1.167.6, 1.167.9 |
@tanstack/react-router-devtools | 1.166.16, 1.166.19 |
@tanstack/router-plugin | 1.167.38, 1.167.41 |
@tanstack/router-vite-plugin | 1.166.53, 1.166.56 |
@tanstack/router-cli | 1.166.46, 1.166.49 |
@tanstack/router-generator | 1.166.45, 1.166.48 |
@tanstack/virtual-file-routes | 1.161.10, 1.161.13 |
@tanstack/history | 1.161.9, 1.161.12 |
router_init.js, suspicious optional dependencies, or vulnerable versions in package.json/lock filescd /path/to/your/project
cd C:\path\to\your\project
cd /path/to/your/project
Scan current directory:
node scan.js
Scan specific folder:
node scan.js /path/to/your/project
Scan home directory:
node scan.js ~
macOS / Linux:
node scan.js ~/your-project > scan-result.json
Windows (Command Prompt):
node scan.js C:\Users\YourName\your-project > scan-result.json
Windows (PowerShell):
node scan.js C:\Users\YourName\your-project | Out-File -FilePath scan-result.json
Scan a single project:
cd /Users/username/my-react-app
node scan.js . > result.json
cat result.json
Scan entire system (macOS/Linux):
node scan.js ~ > full-scan.json
Scan with jq (macOS/Linux) - filter just the risk level:
node scan.js . | jq -r '.risk'
The scanner outputs JSON with the following structure:
{
"scannedRoot": "/path/to/scanned/directory",
"risk": "HIGH|MEDIUM|LOW",
"summary": {
"routerInit": 0,
"optionalDeps": 0,
"badPackageVersions": 0,
"badLockVersions": 0,
"npmLogs": 0,
"errors": 0
},
"findings": {
"routerInit": [],
"optionalDeps": [],
"badPackageVersions": [],
"badLockVersions": [],
"npmLogs": [],
"errors": []
}
}
The scanner automatically skips the following directories to improve performance:
.git.next.nuxt.turbo.cache.DS_Storedistbuildcoverage.yarnFiles larger than 5MB are also skipped.
If the scanner reports HIGH risk:
package.json filesrouter_init.js filesrm -rf node_modules package-lock.json
npm install