pompelmi 0.15.2 → 0.16.3
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.
- package/README.md +54 -0
- package/package.json +45 -35
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
</a>
|
|
11
11
|
<br/>
|
|
12
12
|
<a href="https://www.detectionengineering.net/p/det-eng-weekly-issue-124-the-defcon"><img alt="Featured in Detection Engineering Weekly #124" src="https://img.shields.io/badge/featured-Detection%20Engineering%20Weekly-0A84FF?logo=substack"></a>
|
|
13
|
+
<a href="https://nodeweekly.com/issues/594"><img alt="Featured in Node Weekly #594" src="https://img.shields.io/badge/featured-Node%20Weekly%20%23594-FF6600?logo=node.js"></a>
|
|
14
|
+
<a href="https://bytes.dev/archives/429"><img alt="Featured in Bytes #429" src="https://img.shields.io/badge/featured-Bytes%20%23429-111111"></a>
|
|
13
15
|
<br/>
|
|
14
16
|
|
|
15
17
|
</p>
|
|
@@ -58,6 +60,22 @@
|
|
|
58
60
|
|
|
59
61
|
---
|
|
60
62
|
|
|
63
|
+
<details>
|
|
64
|
+
<summary><strong>Table of contents</strong></summary>
|
|
65
|
+
|
|
66
|
+
- [Install](#installation)
|
|
67
|
+
- [Quick‑start](#quick-start)
|
|
68
|
+
- [GitHub Action](#github-action)
|
|
69
|
+
- [Adapters](#adapters)
|
|
70
|
+
- [Diagrams](#diagrams)
|
|
71
|
+
- [Config](#configuration)
|
|
72
|
+
- [Production checklist](#production-checklist)
|
|
73
|
+
- [YARA](#yara-getting-started)
|
|
74
|
+
- [Quick test](#quick-test-no-eicar)
|
|
75
|
+
- [Security](#security-notes)
|
|
76
|
+
- [FAQ](#faq)
|
|
77
|
+
</details>
|
|
78
|
+
|
|
61
79
|
## 🚀 Overview
|
|
62
80
|
|
|
63
81
|
**pompelmi** scans untrusted file uploads **before** they hit disk. A tiny, TypeScript-first toolkit for Node.js with composable scanners, deep ZIP inspection, and optional signature engines.
|
|
@@ -79,6 +97,34 @@
|
|
|
79
97
|
|
|
80
98
|
> Keywords: file upload security, malware scanning, YARA, Node.js, Express, Koa, Next.js, ZIP scanning, ZIP bomb, PDF JavaScript, Office macros
|
|
81
99
|
|
|
100
|
+
## 🧠 Why pompelmi?
|
|
101
|
+
|
|
102
|
+
- **On‑device, private scanning** – no outbound calls, no data sharing.
|
|
103
|
+
- **Blocks early** – runs *before* you write to disk or persist anything.
|
|
104
|
+
- **Fits your stack** – drop‑in adapters for Express, Koa, Next.js (Fastify plugin in alpha).
|
|
105
|
+
- **Defense‑in‑depth** – ZIP traversal limits, ratio caps, server‑side MIME sniffing, size caps.
|
|
106
|
+
- **Pluggable detection** – bring your own engine (e.g., YARA) via a tiny `{ scan(bytes) }` contract.
|
|
107
|
+
|
|
108
|
+
### Who is it for?
|
|
109
|
+
|
|
110
|
+
- Teams who can’t send uploads to third‑party AV APIs.
|
|
111
|
+
- Apps that need predictable, low‑latency decisions inline.
|
|
112
|
+
- Developers who want simple, typed building blocks instead of a daemon.
|
|
113
|
+
|
|
114
|
+
## 🔍 How it compares
|
|
115
|
+
|
|
116
|
+
| Capability | pompelmi | ClamAV / node‑clam | Cloud AV APIs |
|
|
117
|
+
| --- | --- | --- | --- |
|
|
118
|
+
| Runs fully in‑process | ✅ | ❌ (separate daemon) | ❌ (network calls) |
|
|
119
|
+
| Bytes stay private | ✅ | ✅ | ❌ |
|
|
120
|
+
| Deep ZIP limits & MIME sniff | ✅ | ✅ (archive scan) | ❓ varies |
|
|
121
|
+
| YARA integration | ✅ optional | ❌* | ❓ varies |
|
|
122
|
+
| Framework adapters | ✅ Express/Koa/Next.js | ❌ | ❌ |
|
|
123
|
+
| Works in CI on artifacts | ✅ | ✅ | ❓ varies |
|
|
124
|
+
| Licensing | MIT | GPL (engine) | Proprietary |
|
|
125
|
+
|
|
126
|
+
\* You can run YARA alongside ClamAV, but it’s not built‑in.
|
|
127
|
+
|
|
82
128
|
---
|
|
83
129
|
|
|
84
130
|
## 🔧 Installation
|
|
@@ -568,6 +614,14 @@ You should see an HTTP **422 Unprocessable Entity** (blocked by policy). Clean f
|
|
|
568
614
|
|
|
569
615
|
---
|
|
570
616
|
|
|
617
|
+
[...]
|
|
618
|
+
|
|
619
|
+
## 🔔 Releases & security
|
|
620
|
+
|
|
621
|
+
- **Changelog / releases:** see [GitHub Releases](https://github.com/pompelmi/pompelmi/releases).
|
|
622
|
+
- **Security disclosures:** please use [GitHub Security Advisories](https://github.com/pompelmi/pompelmi/security/advisories). We’ll coordinate a fix before public disclosure.
|
|
623
|
+
- **Production users:** open a [Discussion](https://github.com/pompelmi/pompelmi/discussions) to share requirements or request adapters.
|
|
624
|
+
|
|
571
625
|
## ⭐ Star history
|
|
572
626
|
|
|
573
627
|
[](https://star-history.com/#pompelmi/pompelmi&Date)
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pompelmi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"description": "RFI-safe file uploads for Node.js — Express/Koa/Next.js middleware with deep ZIP inspection, MIME/size checks, and optional YARA scanning.",
|
|
5
5
|
"main": "./dist/pompelmi.cjs",
|
|
6
6
|
"module": "./dist/pompelmi.esm.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
7
|
"type": "module",
|
|
9
8
|
"browser": {
|
|
10
9
|
"yara": false,
|
|
@@ -26,7 +25,12 @@
|
|
|
26
25
|
"@babel/helper-create-regexp-features-plugin>regjsgen": "0.8.0",
|
|
27
26
|
"vitest": "2.1.9",
|
|
28
27
|
"@vitest/coverage-v8": "2.1.9",
|
|
29
|
-
"babel-plugin-polyfill-corejs3": "^0.13.0"
|
|
28
|
+
"babel-plugin-polyfill-corejs3": "^0.13.0",
|
|
29
|
+
"@types/cookies": "0.9.1",
|
|
30
|
+
"@types/koa>@types/cookies": "0.9.1",
|
|
31
|
+
"pompelmi": "workspace:*",
|
|
32
|
+
"@pompelmi/core": "workspace:*",
|
|
33
|
+
"katex": "0.16.10"
|
|
30
34
|
}
|
|
31
35
|
},
|
|
32
36
|
"scripts": {
|
|
@@ -39,53 +43,54 @@
|
|
|
39
43
|
"predocs:deploy": "npm run docs:build",
|
|
40
44
|
"docs:deploy": "gh-pages -d docs -b gh-pages",
|
|
41
45
|
"yara:check": "node scripts/yara-quick-check-cli.mjs",
|
|
42
|
-
"build:core": "pnpm -r --filter
|
|
46
|
+
"build:core": "pnpm -r --filter '!./examples/*' --if-present build",
|
|
47
|
+
"preview": "npm pack --dry-run",
|
|
48
|
+
"typecheck": "tsc -p tsconfig.json --noEmit || tsc -p tsconfig.build.json --noEmit",
|
|
49
|
+
"typecheck:strict": "tsc -p tsconfig.strict.json --noEmit",
|
|
50
|
+
"smoke": "node scripts/smoke.mjs",
|
|
51
|
+
"test:e2e": "node scripts/e2e.mjs",
|
|
52
|
+
"repo:doctor": "pnpm install --frozen-lockfile && pnpm -r --if-present build && pnpm -r --if-present test && npm run -s preview || true && node scripts/smoke.mjs && node scripts/e2e.mjs || true",
|
|
53
|
+
"audit:deps": "depcheck --skip-missing true || true",
|
|
54
|
+
"audit:code": "knip --reporter compact || true",
|
|
55
|
+
"audit:exports": "ts-prune -p tsconfig.json || true",
|
|
56
|
+
"repo:audit": "node scripts/audit.mjs",
|
|
57
|
+
"pack:check": "node scripts/pack-check.mjs",
|
|
58
|
+
"pack:list": "pnpm -r --filter \"@pompelmi/*\" --if-present pack --json --dry-run",
|
|
59
|
+
"pack:strict": "node scripts/pack-check.mjs --strict"
|
|
43
60
|
},
|
|
44
61
|
"license": "MIT",
|
|
45
62
|
"devDependencies": {
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@babel/core": "^7.28.0",
|
|
51
|
-
"@babel/preset-env": "^7.28.0",
|
|
52
|
-
"@babel/preset-typescript": "^7.27.1",
|
|
53
|
-
"@rollup/plugin-babel": "^6.0.4",
|
|
63
|
+
"@biomejs/biome": "^2.2.4",
|
|
64
|
+
"@pompelmi/core": "workspace:*",
|
|
65
|
+
"@pompelmi/engine": "workspace:0.16.3-dev.6",
|
|
66
|
+
"@pompelmi/engine-heuristics": "workspace:^0.1.0",
|
|
54
67
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
55
68
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
56
69
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
57
70
|
"@types/cors": "^2.8.19",
|
|
58
71
|
"@types/express": "^5.0.3",
|
|
59
|
-
"@types/koa": "^2.15.0",
|
|
60
72
|
"@types/multer": "^2.0.0",
|
|
61
73
|
"@types/node": "^24.3.0",
|
|
62
74
|
"@types/react": "^19.1.8",
|
|
63
|
-
"@types/react-dom": "^19.1.6",
|
|
64
|
-
"@types/supertest": "^6.0.3",
|
|
65
75
|
"@types/unzipper": "^0.10.11",
|
|
66
76
|
"@vitest/coverage-v8": "^2",
|
|
67
77
|
"cors": "^2.8.5",
|
|
78
|
+
"depcheck": "^1.4.7",
|
|
68
79
|
"express": "^5.1.0",
|
|
69
80
|
"gh-pages": "^6.3.0",
|
|
81
|
+
"knip": "^5.64.0",
|
|
70
82
|
"multer": "^2.0.2",
|
|
71
83
|
"react": "^18.0.0",
|
|
72
|
-
"react-dom": "^18.0.0",
|
|
73
84
|
"rollup": "^4.x",
|
|
74
|
-
"
|
|
75
|
-
"supertest": "^7.0.0",
|
|
85
|
+
"ts-prune": "^0.10.3",
|
|
76
86
|
"tslib": "^2.8.1",
|
|
77
87
|
"tsup": "^8",
|
|
78
88
|
"tsx": "^4.20.3",
|
|
79
89
|
"typescript": "^5.9.2",
|
|
80
|
-
"vitest": "2.1.9"
|
|
81
|
-
"yazl": "^3.3.1"
|
|
90
|
+
"vitest": "2.1.9"
|
|
82
91
|
},
|
|
83
92
|
"dependencies": {
|
|
84
|
-
"
|
|
85
|
-
"libyara-wasm": "^1.2.1",
|
|
86
|
-
"rollup": "^4.45.1",
|
|
87
|
-
"wasm-feature-detect": "^1.8.0",
|
|
88
|
-
"yara": "npm:@automattic/yara@^2.6.0-beta.2"
|
|
93
|
+
"rollup": "^4.45.1"
|
|
89
94
|
},
|
|
90
95
|
"peerDependencies": {
|
|
91
96
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -95,14 +100,16 @@
|
|
|
95
100
|
"@litko/yara-x": "^0.2.1"
|
|
96
101
|
},
|
|
97
102
|
"exports": {
|
|
98
|
-
".": {
|
|
99
|
-
|
|
100
|
-
"import": "./dist/pompelmi.esm.js",
|
|
101
|
-
"types": "./dist/index.d.ts"
|
|
102
|
-
}
|
|
103
|
+
".": {},
|
|
104
|
+
"./package.json": "./package.json"
|
|
103
105
|
},
|
|
104
106
|
"files": [
|
|
105
|
-
"dist/"
|
|
107
|
+
"dist/",
|
|
108
|
+
"dist",
|
|
109
|
+
"README.md",
|
|
110
|
+
"LICENSE*",
|
|
111
|
+
"package.json",
|
|
112
|
+
"CHANGELOG*"
|
|
106
113
|
],
|
|
107
114
|
"keywords": [
|
|
108
115
|
"security",
|
|
@@ -134,12 +141,15 @@
|
|
|
134
141
|
"example": "examples"
|
|
135
142
|
},
|
|
136
143
|
"author": "",
|
|
137
|
-
"private": false,
|
|
138
|
-
"workspaces": [
|
|
139
|
-
"packages/*"
|
|
140
|
-
],
|
|
141
144
|
"packageManager": "pnpm@9.12.0",
|
|
142
145
|
"resolutions": {
|
|
143
146
|
"process": "0.11.10"
|
|
147
|
+
},
|
|
148
|
+
"sideEffects": false,
|
|
149
|
+
"engines": {
|
|
150
|
+
"node": ">=18"
|
|
151
|
+
},
|
|
152
|
+
"publishConfig": {
|
|
153
|
+
"access": "public"
|
|
144
154
|
}
|
|
145
155
|
}
|