pompelmi 0.35.2 → 0.35.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.
Files changed (2) hide show
  1. package/README.md +100 -74
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,29 +1,70 @@
1
- # Pompelmi
1
+ <div align="center">
2
+ <img src="./assets/logo.svg" alt="Pompelmi logo" width="144" />
3
+
4
+ <h1>Pompelmi</h1>
5
+
6
+ <p><strong>Route-level upload security for Node.js.</strong></p>
7
+
8
+ <p>Inspect untrusted uploads before storage.</p>
9
+
10
+ <p>
11
+ MIME and extension spoofing · archive abuse · risky document and binary
12
+ signals · optional YARA
13
+ </p>
14
+
15
+ <p><code>clean</code> · <code>suspicious</code> · <code>malicious</code></p>
16
+
17
+ <p>
18
+ <sub>Express · Next.js · NestJS · Fastify · Koa · Nuxt/Nitro · S3 quarantine flows · CI/CD</sub>
19
+ </p>
20
+
21
+ <p><sub>Open-source core · MIT · Node.js 18+</sub></p>
22
+
23
+ <p>
24
+ <a href="https://www.npmjs.com/package/pompelmi"><img alt="npm version" src="https://img.shields.io/npm/v/pompelmi" /></a>
25
+ <a href="https://github.com/pompelmi/pompelmi/actions/workflows/ci.yml"><img alt="CI" src="https://img.shields.io/github/actions/workflow/status/pompelmi/pompelmi/ci.yml?label=ci" /></a>
26
+ <a href="https://codecov.io/gh/pompelmi/pompelmi"><img alt="codecov" src="https://codecov.io/gh/pompelmi/pompelmi/graph/badge.svg" /></a>
27
+ <a href="https://github.com/pompelmi/pompelmi/stargazers"><img alt="GitHub stars" src="https://img.shields.io/github/stars/pompelmi/pompelmi?style=social" /></a>
28
+ <a href="https://www.npmjs.com/package/pompelmi"><img alt="npm weekly downloads" src="https://img.shields.io/npm/dw/pompelmi" /></a>
29
+ <a href="https://www.npmjs.com/package/pompelmi"><img alt="npm monthly downloads" src="https://img.shields.io/npm/dm/pompelmi" /></a>
30
+ </p>
31
+
32
+ <p>
33
+ <a href="https://pompelmi.github.io/pompelmi/getting-started/"><strong>Getting started</strong></a>
34
+ ·
35
+ <a href="https://pompelmi.github.io/pompelmi/#browser-preview"><strong>Browser preview</strong></a>
36
+ ·
37
+ <a href="./examples/demo"><strong>Express demo</strong></a>
38
+ ·
39
+ <a href="./examples/README.md"><strong>Examples</strong></a>
40
+ </p>
41
+ </div>
42
+
43
+ <p align="center">
44
+ Mentioned by <a href="https://nodeweekly.com/issues/594">Node Weekly</a>,
45
+ <a href="https://stackoverflow.blog/2026/02/23/defense-against-uploads-oss-file-scanner-pompelmi/">Stack Overflow</a>,
46
+ <a href="https://www.helpnetsecurity.com/2026/02/02/pompelmi-open-source-secure-file-upload-scanning-node-js/">Help Net Security</a>,
47
+ <a href="https://github.com/sorrycc/awesome-javascript">Awesome JavaScript</a>,
48
+ and
49
+ <a href="https://github.com/dzharii/awesome-typescript">Awesome TypeScript</a>.
50
+ </p>
2
51
 
3
- In-process file upload security for Node.js. Inspect untrusted files before storage so your application can reject, quarantine, or accept with context.
4
-
5
- [![npm version](https://img.shields.io/npm/v/pompelmi)](https://www.npmjs.com/package/pompelmi)
6
- [![CI](https://img.shields.io/github/actions/workflow/status/pompelmi/pompelmi/ci.yml?label=ci)](https://github.com/pompelmi/pompelmi/actions/workflows/ci.yml)
7
- [![GitHub stars](https://img.shields.io/github/stars/pompelmi/pompelmi)](https://github.com/pompelmi/pompelmi/stargazers)
52
+ ## Quick Start
8
53
 
9
- Pompelmi helps reduce:
54
+ Install the core package:
10
55
 
11
- - MIME / extension spoofing and magic-byte mismatches
12
- - risky archive structures such as ZIP bombs, traversal, and deep nesting
13
- - risky document and binary patterns such as PDF actions, Office macro hints, PE signatures, and polyglot files
14
- - store-first upload flows that need a clean / suspicious / malicious verdict before persistence
15
- - known malicious matches when you plug in YARA or another scanner
56
+ ```bash
57
+ npm install pompelmi
58
+ ```
16
59
 
17
- Install: `npm install pompelmi`
18
-
19
- ## Quick Start
60
+ Minimal route-level example:
20
61
 
21
62
  ```ts
22
63
  import { scanBytes, STRICT_PUBLIC_UPLOAD } from 'pompelmi';
23
64
 
24
- const report = await scanBytes(file.buffer, {
25
- filename: file.originalname,
26
- mimeType: file.mimetype,
65
+ const report = await scanBytes(req.file.buffer, {
66
+ filename: req.file.originalname,
67
+ mimeType: req.file.mimetype,
27
68
  policy: STRICT_PUBLIC_UPLOAD,
28
69
  failClosed: true,
29
70
  });
@@ -35,17 +76,27 @@ if (report.verdict !== 'clean') {
35
76
  reasons: report.reasons,
36
77
  });
37
78
  }
79
+
80
+ return res.status(200).json({ verdict: report.verdict });
38
81
  ```
39
82
 
40
- Need a local scan in under a minute? Start with [Getting started](https://pompelmi.github.io/pompelmi/getting-started/). Want a preview of the verdict flow first? Open the [browser preview](https://pompelmi.github.io/pompelmi/#browser-preview). Want a minimal server route? See [examples/demo](./examples/demo).
83
+ Start with [Getting started](https://pompelmi.github.io/pompelmi/getting-started/) for a local scan in under a minute, open the [browser preview](https://pompelmi.github.io/pompelmi/#browser-preview) to inspect the verdict flow without sending files anywhere, or run the minimal [Express demo](./examples/demo).
41
84
 
42
- If Pompelmi fits the way you handle upload risk, a GitHub star helps more Node.js teams find the project.
85
+ If Pompelmi matches how you want upload security to work, star the repo so more Node.js teams can find it.
43
86
 
44
87
  ## Why It Exists
45
88
 
46
- Upload endpoints are part of your attack surface. A file can look harmless at the form layer and only become dangerous after storage, extraction, rendering, or downstream parsing.
89
+ Upload endpoints are part of your attack surface. A file can look harmless at the form layer and become dangerous only after storage, extraction, rendering, or downstream parsing.
90
+
91
+ Pompelmi keeps the first decision inside the application path, where the route still knows the file class, trust level, storage path, and failure mode.
92
+
93
+ ## What It Checks
47
94
 
48
- Pompelmi keeps the first decision inside the application path, where the route still knows the file class, the trust level, and the right failure mode.
95
+ - MIME sniffing, magic-byte validation, and extension allowlists
96
+ - risky archive structures such as traversal, deep nesting, entry-count abuse, and ZIP bomb-style expansion
97
+ - suspicious document and binary signals such as risky PDF actions, Office macro hints, PE headers, and polyglot files
98
+ - optional YARA or other scanner matches
99
+ - route-level verdicts that support reject, quarantine, or promote workflows
49
100
 
50
101
  ## Where It Fits
51
102
 
@@ -55,9 +106,18 @@ Pompelmi keeps the first decision inside the application path, where the route s
55
106
  - document, image, and archive routes that need different policies
56
107
  - CI/CD or internal artifact scanning before promotion
57
108
 
109
+ ## Why Not Just X?
110
+
111
+ | Approach | Useful for | What it misses |
112
+ | --- | --- | --- |
113
+ | Browser MIME and extension checks | Fast client-side hints and UX feedback | Filenames and client-reported MIME are easy to spoof |
114
+ | Simple file-type or magic-byte checks | Confirming the file appears to be the claimed type | Risky internal structure, archive abuse, and route policy decisions |
115
+ | Antivirus-only thinking | Known malicious matches and signature-based detection | Route context, spoofing checks, storage decisions, and non-signature risk signals |
116
+ | Pompelmi at the upload route | Inspect-first, store-later decisions with policy, structure checks, and optional YARA | It is not a full antivirus replacement on its own |
117
+
58
118
  ## Integrations
59
119
 
60
- - Express: [Docs](https://pompelmi.github.io/pompelmi/how-to/express/) · [Example](./examples/express-minimal)
120
+ - Express: [Docs](https://pompelmi.github.io/pompelmi/how-to/express/) · [Minimal example](./examples/express-minimal) · [Demo](./examples/demo)
61
121
  - Next.js: [Docs](https://pompelmi.github.io/pompelmi/how-to/nextjs/) · [Example](./examples/next-app-router)
62
122
  - NestJS: [Docs](https://pompelmi.github.io/pompelmi/how-to/nestjs/) · [Example app](./examples/nestjs-app)
63
123
  - Fastify: [Docs](https://pompelmi.github.io/pompelmi/how-to/fastify/) · [Package](./packages/fastify-plugin)
@@ -66,65 +126,27 @@ Pompelmi keeps the first decision inside the application path, where the route s
66
126
  - S3 / object storage: [Tutorial](https://pompelmi.github.io/pompelmi/tutorials/secure-s3-presigned-uploads-with-malware-scanning/) · [Use case](https://pompelmi.github.io/pompelmi/use-cases/s3-presigned-upload-security/)
67
127
  - CI/CD: [Use case](https://pompelmi.github.io/pompelmi/use-cases/cicd-artifact-scanning/) · [Blog](https://pompelmi.github.io/pompelmi/blog/cicd-scan-build-artifacts/)
68
128
 
69
- ## Docs and Examples
129
+ ## Demo, Preview, and Examples
130
+
131
+ ![Pompelmi upload security demo](assets/malware-detection-node-demo.gif)
132
+
133
+ - [Browser preview](https://pompelmi.github.io/pompelmi/#browser-preview) for a fast local evaluation of the verdict UX
134
+ - [Demo](./examples/demo) for a tiny Express upload gate that returns `clean`, `suspicious`, or `malicious` before storage
135
+ - [Examples index](./examples/README.md) for framework-specific and production-oriented examples
136
+
137
+ ## Docs
70
138
 
71
139
  - [Docs home](https://pompelmi.github.io/pompelmi/)
72
140
  - [Getting started](https://pompelmi.github.io/pompelmi/getting-started/)
73
141
  - [Use cases](https://pompelmi.github.io/pompelmi/use-cases/)
74
142
  - [Comparisons](https://pompelmi.github.io/pompelmi/comparisons/)
75
143
  - [Tutorials](https://pompelmi.github.io/pompelmi/tutorials/)
76
- - [Examples index](./examples/README.md)
77
- - [Demo example](./examples/demo)
78
144
  - [Featured in](https://pompelmi.github.io/pompelmi/featured-in/)
79
145
  - [Translations](https://pompelmi.github.io/pompelmi/translations/)
80
- - [Contributing](./CONTRIBUTING.md)
81
- - [Security](./SECURITY.md)
82
- - [Roadmap](./ROADMAP.md)
83
146
 
84
- ## Demo
147
+ ## Enterprise and Commercial Support
85
148
 
86
- ![Pompelmi demo](assets/malware-detection-node-demo.gif)
87
-
88
- The website includes a client-side [browser preview](https://pompelmi.github.io/pompelmi/#browser-preview) for fast evaluation. The repo also ships a minimal [Express upload gate demo](./examples/demo) that returns `clean`, `suspicious`, or `malicious` before storage.
89
-
90
- ## What It Checks
91
-
92
- Pompelmi is designed for the upload boundary, not as a full antivirus replacement.
93
-
94
- It can combine:
95
-
96
- - MIME sniffing, magic-byte checks, and extension allowlists
97
- - archive controls such as ZIP bombs, traversal, entry counts, expansion limits, and nesting limits
98
- - common heuristics for risky PDFs, Office macro hints, executables, and other suspicious structures
99
- - optional YARA-based signature matching
100
- - route-level `clean`, `suspicious`, and `malicious` decisions with quarantine-friendly workflows
101
-
102
- ## Ecosystem
103
-
104
- - `pompelmi`
105
- - `@pompelmi/express-middleware`
106
- - `@pompelmi/koa-middleware`
107
- - `@pompelmi/next-upload`
108
- - `@pompelmi/nestjs-integration`
109
- - `@pompelmi/fastify-plugin`
110
- - `@pompelmi/ui-react`
111
- - `@pompelmi/cli`
112
-
113
- ## Repository Layout
114
-
115
- - `src/` core library
116
- - `packages/` framework adapters and supporting packages
117
- - `examples/` runnable examples
118
- - `tests/` test coverage
119
- - `website/` public docs, blog, and discovery site
120
-
121
- ## Development
122
-
123
- ```bash
124
- pnpm install
125
- pnpm test
126
- pnpm build
127
- ```
149
+ The MIT core remains the primary path. Teams that need private rollout help, architecture review, or policy tuning can use the existing [enterprise support path](https://pompelmi.github.io/pompelmi/enterprise/).
128
150
 
129
151
  <!-- MENTIONS:START -->
130
152
 
@@ -157,6 +179,10 @@ Full page: [pompelmi.github.io/pompelmi/featured-in](https://pompelmi.github.io/
157
179
 
158
180
  <!-- MENTIONS:END -->
159
181
 
160
- ## License
182
+ ## Project
161
183
 
162
- [MIT](./LICENSE)
184
+ - [Contributing](./CONTRIBUTING.md)
185
+ - [Security](./SECURITY.md)
186
+ - [Roadmap](./ROADMAP.md)
187
+ - [GitHub Discussions](https://github.com/pompelmi/pompelmi/discussions)
188
+ - [License](./LICENSE)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pompelmi",
3
- "version": "0.35.2",
4
- "description": "Secure file uploads for Node.js. Scan untrusted files before storage with in-process, local-first checks for MIME spoofing, archive bombs, risky document structures, and optional YARA.",
3
+ "version": "0.35.3",
4
+ "description": "Inspect untrusted uploads before storage in Node.js. Open-source upload security with checks for spoofing, archive abuse, risky document and binary signals, and optional YARA.",
5
5
  "main": "./dist/pompelmi.cjs",
6
6
  "module": "./dist/pompelmi.esm.js",
7
7
  "type": "module",