@georgegiosue/pzx 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +70 -0
  3. package/dist/index.js +1487 -0
  4. package/package.json +39 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 George Giosue
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ <div align="center">
2
+
3
+ # Package Zero-trust eXecute
4
+
5
+ **Secure Javascript Ecosystem supply chain. Advanced SCA and isolated runtime validation.**
6
+
7
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
8
+ [![Bun](https://img.shields.io/badge/runtime-Bun-f9f1e1.svg)](https://bun.sh)
9
+ [![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)]()
10
+ [![TypeScript](https://img.shields.io/badge/TypeScript-strict-3178c6.svg)]()
11
+
12
+ </div>
13
+
14
+ ---
15
+
16
+ Scans your filesystem, resolves **real installed versions**, checks [OSV](https://osv.dev) for CVEs, runs supply chain heuristics, performs AST analysis with `Bun.Transpiler`, and detonates suspicious packages in a sandboxed environment. Zero dependencies.
17
+
18
+ ## Install
19
+
20
+ ```bash
21
+ bunx pzx lodash
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```bash
27
+ pzx [package] [version] [--root <path>] [--home] [--help]
28
+ ```
29
+
30
+ ```bash
31
+ pzx # scan ALL installed packages
32
+ pzx lodash 4.17.20 # check specific package
33
+ pzx express --home # scan from home directory
34
+ pzx @babel/core -r ~/projects # scan specific path
35
+ ```
36
+
37
+ Without arguments, pzx enters **full scan mode**: discovers every installed package, runs static analysis locally, and only queries external APIs for packages flagged as suspicious.
38
+
39
+ ## Analysis Engines
40
+
41
+ | Engine | What it does |
42
+ |--------|-------------|
43
+ | **OSV** | Checks installed versions against known CVEs |
44
+ | **Registry** | Detects abandonment, deprecation, quarantine, typosquatting |
45
+ | **Regex IoC** | `eval()`, `child_process`, base64, IP URLs, env exfiltration |
46
+ | **AST** | `Bun.Transpiler` import scanning for sensitive system modules |
47
+ | **Dep audit** | Random names, URL/IP/file versions in sub-dependencies |
48
+ | **Sandbox** | Detonates suspicious packages with intercepted `fetch`, `fs`, `exec` |
49
+
50
+ ## Sandbox
51
+
52
+ Packages flagged by static analysis are executed in a controlled environment:
53
+
54
+ - **Mock environment** intercepts `fetch`, `fs`, `child_process`, `http/https`
55
+ - **Empty env** — no `AWS_SECRET_KEY`, no `NPM_TOKEN`, nothing to steal
56
+ - **1500ms timeout** — kills the process if it blocks (C2 wait, infinite loop)
57
+ - Violations are classified: `NETWORK`, `EXEC`, `FS_READ`
58
+
59
+ ## Exit Codes
60
+
61
+ `0` no vulnerabilities | `1` error | `2` vulnerabilities found
62
+
63
+ ## License
64
+
65
+ [MIT](LICENSE)
66
+ </div>
67
+
68
+ ## Acknowledgements
69
+
70
+ *Most (if not all) of this was built by AI xd*