pompelmi 0.34.9 → 0.35.0

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 (112) hide show
  1. package/README.md +26 -14
  2. package/dist/pompelmi.audit.cjs +13 -15
  3. package/dist/pompelmi.audit.cjs.map +1 -1
  4. package/dist/pompelmi.audit.esm.js +13 -15
  5. package/dist/pompelmi.audit.esm.js.map +1 -1
  6. package/dist/pompelmi.browser.cjs +585 -534
  7. package/dist/pompelmi.browser.cjs.map +1 -1
  8. package/dist/pompelmi.browser.esm.js +585 -534
  9. package/dist/pompelmi.browser.esm.js.map +1 -1
  10. package/dist/pompelmi.cjs +2066 -2016
  11. package/dist/pompelmi.cjs.map +1 -1
  12. package/dist/pompelmi.esm.js +2066 -2016
  13. package/dist/pompelmi.esm.js.map +1 -1
  14. package/dist/pompelmi.hooks.cjs +2 -2
  15. package/dist/pompelmi.hooks.cjs.map +1 -1
  16. package/dist/pompelmi.hooks.esm.js +2 -2
  17. package/dist/pompelmi.hooks.esm.js.map +1 -1
  18. package/dist/pompelmi.policy-packs.cjs +74 -73
  19. package/dist/pompelmi.policy-packs.cjs.map +1 -1
  20. package/dist/pompelmi.policy-packs.esm.js +74 -73
  21. package/dist/pompelmi.policy-packs.esm.js.map +1 -1
  22. package/dist/pompelmi.quarantine.cjs +135 -133
  23. package/dist/pompelmi.quarantine.cjs.map +1 -1
  24. package/dist/pompelmi.quarantine.esm.js +135 -133
  25. package/dist/pompelmi.quarantine.esm.js.map +1 -1
  26. package/dist/pompelmi.react.cjs +585 -534
  27. package/dist/pompelmi.react.cjs.map +1 -1
  28. package/dist/pompelmi.react.esm.js +585 -534
  29. package/dist/pompelmi.react.esm.js.map +1 -1
  30. package/dist/types/audit.d.ts +12 -12
  31. package/dist/types/browser-index.d.ts +12 -12
  32. package/dist/types/config.d.ts +4 -4
  33. package/dist/types/engines/dynamic-taint.d.ts +1 -1
  34. package/dist/types/engines/hybrid-orchestrator.d.ts +1 -1
  35. package/dist/types/engines/hybrid-taint-integration.d.ts +6 -6
  36. package/dist/types/engines/taint-policies.d.ts +4 -4
  37. package/dist/types/hipaa-compliance.d.ts +2 -2
  38. package/dist/types/hooks.d.ts +2 -2
  39. package/dist/types/index.d.ts +20 -20
  40. package/dist/types/node/scanDir.d.ts +5 -5
  41. package/dist/types/policy-packs.d.ts +2 -2
  42. package/dist/types/presets.d.ts +3 -3
  43. package/dist/types/quarantine/index.d.ts +3 -3
  44. package/dist/types/quarantine/storage.d.ts +1 -1
  45. package/dist/types/quarantine/types.d.ts +3 -3
  46. package/dist/types/quarantine/workflow.d.ts +4 -4
  47. package/dist/types/react-index.d.ts +2 -2
  48. package/dist/types/risk.d.ts +1 -1
  49. package/dist/types/scan/remote.d.ts +2 -2
  50. package/dist/types/scan.d.ts +5 -5
  51. package/dist/types/scanners/common-heuristics.d.ts +1 -1
  52. package/dist/types/scanners/zip-bomb-guard.d.ts +1 -1
  53. package/dist/types/src/audit.d.ts +84 -0
  54. package/dist/types/src/browser-index.d.ts +29 -0
  55. package/dist/types/src/config.d.ts +143 -0
  56. package/dist/types/src/engines/dynamic-taint.d.ts +102 -0
  57. package/dist/types/src/engines/hybrid-orchestrator.d.ts +65 -0
  58. package/dist/types/src/engines/hybrid-taint-integration.d.ts +129 -0
  59. package/dist/types/src/engines/taint-policies.d.ts +84 -0
  60. package/dist/types/src/hipaa-compliance.d.ts +110 -0
  61. package/dist/types/src/hooks.d.ts +89 -0
  62. package/dist/types/src/index.d.ts +29 -0
  63. package/dist/types/src/magic.d.ts +7 -0
  64. package/dist/types/src/node/scanDir.d.ts +30 -0
  65. package/dist/types/src/policy-packs.d.ts +98 -0
  66. package/dist/types/src/policy.d.ts +12 -0
  67. package/dist/types/src/presets.d.ts +72 -0
  68. package/dist/types/src/quarantine/index.d.ts +18 -0
  69. package/dist/types/src/quarantine/storage.d.ts +77 -0
  70. package/dist/types/src/quarantine/types.d.ts +78 -0
  71. package/dist/types/src/quarantine/workflow.d.ts +97 -0
  72. package/dist/types/src/react-index.d.ts +13 -0
  73. package/dist/types/src/risk.d.ts +18 -0
  74. package/dist/types/src/scan/remote.d.ts +12 -0
  75. package/dist/types/src/scan.d.ts +17 -0
  76. package/dist/types/src/scanners/common-heuristics.d.ts +14 -0
  77. package/dist/types/src/scanners/zip-bomb-guard.d.ts +9 -0
  78. package/dist/types/src/scanners/zipTraversalGuard.d.ts +19 -0
  79. package/dist/types/src/stream.d.ts +10 -0
  80. package/dist/types/src/types/decompilation.d.ts +96 -0
  81. package/dist/types/src/types/taint-tracking.d.ts +495 -0
  82. package/dist/types/src/types.d.ts +48 -0
  83. package/dist/types/src/useFileScanner.d.ts +15 -0
  84. package/dist/types/src/utils/advanced-detection.d.ts +21 -0
  85. package/dist/types/src/utils/batch-scanner.d.ts +62 -0
  86. package/dist/types/src/utils/cache-manager.d.ts +95 -0
  87. package/dist/types/src/utils/export.d.ts +51 -0
  88. package/dist/types/src/utils/performance-metrics.d.ts +68 -0
  89. package/dist/types/src/utils/threat-intelligence.d.ts +96 -0
  90. package/dist/types/src/validate.d.ts +7 -0
  91. package/dist/types/src/verdict.d.ts +2 -0
  92. package/dist/types/src/yara/browser.d.ts +7 -0
  93. package/dist/types/src/yara/index.d.ts +17 -0
  94. package/dist/types/src/yara/node.d.ts +2 -0
  95. package/dist/types/src/yara/remote.d.ts +10 -0
  96. package/dist/types/src/yara-bridge.d.ts +3 -0
  97. package/dist/types/src/zip.d.ts +13 -0
  98. package/dist/types/types/decompilation.d.ts +4 -4
  99. package/dist/types/types/taint-tracking.d.ts +19 -19
  100. package/dist/types/types.d.ts +3 -3
  101. package/dist/types/useFileScanner.d.ts +1 -1
  102. package/dist/types/utils/advanced-detection.d.ts +1 -1
  103. package/dist/types/utils/batch-scanner.d.ts +3 -3
  104. package/dist/types/utils/cache-manager.d.ts +1 -1
  105. package/dist/types/utils/export.d.ts +2 -2
  106. package/dist/types/utils/threat-intelligence.d.ts +4 -4
  107. package/dist/types/verdict.d.ts +1 -1
  108. package/dist/types/yara/browser.d.ts +1 -1
  109. package/dist/types/yara/index.d.ts +1 -1
  110. package/dist/types/yara/node.d.ts +1 -1
  111. package/dist/types/yara/remote.d.ts +2 -2
  112. package/package.json +6 -6
@@ -7,15 +7,15 @@
7
7
  /**
8
8
  * Taint source types indicating where tainted data originates
9
9
  */
10
- export type TaintSource = 'user_input' | 'file_read' | 'network_recv' | 'registry_read' | 'environment' | 'crypto_weak' | 'external_api' | 'memory_leak' | 'time_source' | 'custom';
10
+ export type TaintSource = "user_input" | "file_read" | "network_recv" | "registry_read" | "environment" | "crypto_weak" | "external_api" | "memory_leak" | "time_source" | "custom";
11
11
  /**
12
12
  * Taint sink types indicating where tainted data should not flow
13
13
  */
14
- export type TaintSink = 'exec_function' | 'file_write' | 'network_send' | 'registry_write' | 'sql_query' | 'format_string' | 'memory_alloc' | 'crypto_key' | 'auth_check' | 'log_output' | 'custom';
14
+ export type TaintSink = "exec_function" | "file_write" | "network_send" | "registry_write" | "sql_query" | "format_string" | "memory_alloc" | "crypto_key" | "auth_check" | "log_output" | "custom";
15
15
  /**
16
16
  * Taint propagation operations that affect taint flow
17
17
  */
18
- export type TaintOperation = 'copy' | 'arithmetic' | 'bitwise' | 'comparison' | 'concatenation' | 'substring' | 'conversion' | 'encryption' | 'hash' | 'sanitization' | 'validation' | 'encoding' | 'custom';
18
+ export type TaintOperation = "copy" | "arithmetic" | "bitwise" | "comparison" | "concatenation" | "substring" | "conversion" | "encryption" | "hash" | "sanitization" | "validation" | "encoding" | "custom";
19
19
  /**
20
20
  * Taint label with metadata for tracking
21
21
  */
@@ -35,7 +35,7 @@ export interface TaintLabel {
35
35
  confidence: number;
36
36
  /** Optional metadata for custom analysis */
37
37
  metadata?: {
38
- severity?: 'low' | 'medium' | 'high' | 'critical';
38
+ severity?: "low" | "medium" | "high" | "critical";
39
39
  description?: string;
40
40
  tags?: string[];
41
41
  [key: string]: unknown;
@@ -136,7 +136,7 @@ export interface TaintConfig {
136
136
  hipaaCompliance?: {
137
137
  enabled: boolean;
138
138
  sanitizeAddresses?: boolean;
139
- auditLevel?: 'minimal' | 'standard' | 'comprehensive';
139
+ auditLevel?: "minimal" | "standard" | "comprehensive";
140
140
  };
141
141
  }
142
142
  /**
@@ -169,7 +169,7 @@ export interface TaintFlow {
169
169
  /** Overall confidence of this flow */
170
170
  confidence: number;
171
171
  /** Severity assessment */
172
- severity: 'low' | 'medium' | 'high' | 'critical';
172
+ severity: "low" | "medium" | "high" | "critical";
173
173
  /** Whether this represents a security vulnerability */
174
174
  isVulnerability: boolean;
175
175
  /** Additional metadata */
@@ -185,7 +185,7 @@ export interface TaintFlow {
185
185
  */
186
186
  export interface TaintAnalysisResult {
187
187
  /** Analysis engine identifier */
188
- engine: 'dynamic-taint' | 'hybrid-taint';
188
+ engine: "dynamic-taint" | "hybrid-taint";
189
189
  /** Analysis success status */
190
190
  success: boolean;
191
191
  /** Total analysis time in milliseconds */
@@ -220,11 +220,11 @@ export interface TaintAnalysisResult {
220
220
  /**
221
221
  * Analysis engine types supported by the orchestrator
222
222
  */
223
- export type AnalysisEngine = 'binaryninja-hlil' | 'ghidra-pcode' | 'dynamic-taint' | 'static-analysis' | 'symbolic-execution' | 'fuzzing' | 'custom';
223
+ export type AnalysisEngine = "binaryninja-hlil" | "ghidra-pcode" | "dynamic-taint" | "static-analysis" | "symbolic-execution" | "fuzzing" | "custom";
224
224
  /**
225
225
  * Analysis phase in the hybrid orchestration pipeline
226
226
  */
227
- export type AnalysisPhase = 'preprocessing' | 'static' | 'dynamic' | 'taint' | 'correlation' | 'postprocessing' | 'reporting';
227
+ export type AnalysisPhase = "preprocessing" | "static" | "dynamic" | "taint" | "correlation" | "postprocessing" | "reporting";
228
228
  /**
229
229
  * Engine capability descriptor
230
230
  */
@@ -232,16 +232,16 @@ export interface EngineCapability {
232
232
  /** Engine identifier */
233
233
  engine: AnalysisEngine;
234
234
  /** Supported analysis types */
235
- capabilities: Array<'decompilation' | 'disassembly' | 'taint_tracking' | 'control_flow' | 'data_flow' | 'symbolic_execution' | 'vulnerability_detection' | 'obfuscation_analysis' | 'crypto_analysis' | 'api_analysis'>;
235
+ capabilities: Array<"decompilation" | "disassembly" | "taint_tracking" | "control_flow" | "data_flow" | "symbolic_execution" | "vulnerability_detection" | "obfuscation_analysis" | "crypto_analysis" | "api_analysis">;
236
236
  /** Supported file formats */
237
237
  supportedFormats: string[];
238
238
  /** Supported architectures */
239
239
  supportedArchitectures: string[];
240
240
  /** Performance characteristics */
241
241
  performance: {
242
- speed: 'fast' | 'medium' | 'slow';
243
- accuracy: 'low' | 'medium' | 'high';
244
- memoryUsage: 'low' | 'medium' | 'high';
242
+ speed: "fast" | "medium" | "slow";
243
+ accuracy: "low" | "medium" | "high";
244
+ memoryUsage: "low" | "medium" | "high";
245
245
  };
246
246
  /** Resource requirements */
247
247
  requirements: {
@@ -290,7 +290,7 @@ export interface TaskResult {
290
290
  /** Engine that executed the task */
291
291
  engine: AnalysisEngine;
292
292
  /** Execution status */
293
- status: 'success' | 'failed' | 'timeout' | 'cancelled';
293
+ status: "success" | "failed" | "timeout" | "cancelled";
294
294
  /** Result data */
295
295
  result?: any;
296
296
  /** Execution metrics */
@@ -348,7 +348,7 @@ export interface OrchestrationStrategy {
348
348
  /** Enable cross-engine result correlation */
349
349
  enabled: boolean;
350
350
  /** Correlation algorithms to use */
351
- algorithms: Array<'similarity' | 'overlap' | 'consensus' | 'weighted'>;
351
+ algorithms: Array<"similarity" | "overlap" | "consensus" | "weighted">;
352
352
  /** Confidence weighting by engine */
353
353
  engineWeights: {
354
354
  [engine in AnalysisEngine]?: number;
@@ -389,7 +389,7 @@ export interface HybridConfig {
389
389
  /** Result aggregation settings */
390
390
  aggregation: {
391
391
  /** How to combine results from multiple engines */
392
- method: 'union' | 'intersection' | 'weighted' | 'consensus';
392
+ method: "union" | "intersection" | "weighted" | "consensus";
393
393
  /** Minimum confidence threshold for final results */
394
394
  confidenceThreshold: number;
395
395
  /** Whether to include intermediate results */
@@ -439,8 +439,8 @@ export interface HybridAnalysisResult {
439
439
  };
440
440
  /** Recommendations based on analysis */
441
441
  recommendations?: Array<{
442
- type: 'security' | 'performance' | 'analysis';
443
- severity: 'info' | 'warning' | 'critical';
442
+ type: "security" | "performance" | "analysis";
443
+ severity: "info" | "warning" | "critical";
444
444
  message: string;
445
445
  evidence?: any;
446
446
  }>;
@@ -492,4 +492,4 @@ export interface HybridOrchestrator {
492
492
  estimatedTimeRemaining: number;
493
493
  }>;
494
494
  }
495
- export { type DecompilationMatch, type FunctionAnalysis, type DecompilationResult, type DecompilationScanner, type BinaryNinjaOptions, type GhidraOptions } from './decompilation';
495
+ export type { BinaryNinjaOptions, DecompilationMatch, DecompilationResult, DecompilationScanner, FunctionAnalysis, GhidraOptions, } from "./decompilation";
@@ -1,15 +1,15 @@
1
1
  /** Shared types for Pompelmi */
2
- export type Verdict = 'clean' | 'suspicious' | 'malicious';
2
+ export type Verdict = "clean" | "suspicious" | "malicious";
3
3
  export interface YaraMatch {
4
4
  rule: string;
5
5
  namespace?: string;
6
6
  tags?: string[];
7
7
  meta?: Record<string, unknown>;
8
8
  }
9
- export * from './types/decompilation';
9
+ export * from "./types/decompilation";
10
10
  export interface Match {
11
11
  rule: string;
12
- severity?: 'info' | 'low' | 'medium' | 'high' | 'critical' | 'suspicious' | 'malicious';
12
+ severity?: "info" | "low" | "medium" | "high" | "critical" | "suspicious" | "malicious";
13
13
  meta?: Record<string, unknown>;
14
14
  }
15
15
  export interface FileInfo {
@@ -1,4 +1,4 @@
1
- import type { ScanReport } from './types';
1
+ import type { ScanReport } from "./types";
2
2
  /**
3
3
  * React Hook: handles <input type="file" onChange> with validation + scanning.
4
4
  */
@@ -2,7 +2,7 @@
2
2
  * Advanced threat detection utilities
3
3
  * @module utils/advanced-detection
4
4
  */
5
- import type { Match } from '../types';
5
+ import type { Match } from "../types";
6
6
  /**
7
7
  * Enhanced polyglot file detection
8
8
  * Detects files that can be interpreted as multiple formats
@@ -2,9 +2,9 @@
2
2
  * Batch scanning with concurrency control
3
3
  * @module utils/batch-scanner
4
4
  */
5
- import type { ScanReport, ScanContext } from '../types';
6
- import { type ScanOptions } from '../scan';
7
- export interface BatchScanOptions extends Omit<ScanOptions, 'ctx'> {
5
+ import { type ScanOptions } from "../scan";
6
+ import type { ScanContext, ScanReport } from "../types";
7
+ export interface BatchScanOptions extends Omit<ScanOptions, "ctx"> {
8
8
  /** Maximum concurrent scans (default: 5) */
9
9
  concurrency?: number;
10
10
  /** Callback for individual scan completion */
@@ -2,7 +2,7 @@
2
2
  * Cache management system for scan results
3
3
  * @module utils/cache-manager
4
4
  */
5
- import type { ScanReport } from '../types';
5
+ import type { ScanReport } from "../types";
6
6
  export interface CacheEntry {
7
7
  /** Scan report */
8
8
  report: ScanReport;
@@ -2,8 +2,8 @@
2
2
  * Export utilities for scan results
3
3
  * @module utils/export
4
4
  */
5
- import type { ScanReport } from '../types';
6
- export type ExportFormat = 'json' | 'csv' | 'markdown' | 'html' | 'sarif';
5
+ import type { ScanReport } from "../types";
6
+ export type ExportFormat = "json" | "csv" | "markdown" | "html" | "sarif";
7
7
  export interface ExportOptions {
8
8
  /** Include detailed match information */
9
9
  includeDetails?: boolean;
@@ -2,7 +2,7 @@
2
2
  * Threat intelligence integration and enhanced detection
3
3
  * @module utils/threat-intelligence
4
4
  */
5
- import type { ScanReport } from '../types';
5
+ import type { ScanReport } from "../types";
6
6
  export interface ThreatIntelligenceSource {
7
7
  /** Source name */
8
8
  name: string;
@@ -29,10 +29,10 @@ export interface EnhancedScanReport {
29
29
  /** Risk score (0-100) */
30
30
  riskScore?: number;
31
31
  /** Include all properties from ScanReport */
32
- verdict: import('../types').Verdict;
33
- matches: import('../types').YaraMatch[];
32
+ verdict: import("../types").Verdict;
33
+ matches: import("../types").YaraMatch[];
34
34
  reasons?: string[];
35
- file?: import('../types').FileInfo;
35
+ file?: import("../types").FileInfo;
36
36
  durationMs?: number;
37
37
  error?: string;
38
38
  ok: boolean;
@@ -1,2 +1,2 @@
1
- import type { YaraMatch, Verdict } from './types';
1
+ import type { Verdict, YaraMatch } from "./types";
2
2
  export declare function mapMatchesToVerdict(matches?: YaraMatch[]): Verdict;
@@ -1,4 +1,4 @@
1
- import type { YaraEngine } from './index';
1
+ import type { YaraEngine } from "./index";
2
2
  /**
3
3
  * Engine YARA lato browser — NO WASM.
4
4
  * È un no-op sicuro: non produce match e non richiede dipendenze native.
@@ -14,4 +14,4 @@ export interface YaraEngine {
14
14
  export declare function createYaraEngine(): Promise<YaraEngine>;
15
15
  export declare function createYaraScannerFromRules(rulesSource: string): Promise<YaraCompiled>;
16
16
  export declare function createYaraScannerFromFile(rulesPath: string): Promise<YaraCompiled>;
17
- export { createRemoteEngine } from './remote';
17
+ export { createRemoteEngine } from "./remote";
@@ -1,2 +1,2 @@
1
- import type { YaraEngine } from './index';
1
+ import type { YaraEngine } from "./index";
2
2
  export declare function createNodeEngine(): Promise<YaraEngine>;
@@ -1,10 +1,10 @@
1
- import type { YaraEngine } from './index';
1
+ import type { YaraEngine } from "./index";
2
2
  export interface RemoteEngineOptions {
3
3
  endpoint: string;
4
4
  headers?: Record<string, string>;
5
5
  rulesField?: string;
6
6
  fileField?: string;
7
- mode?: 'multipart' | 'json-base64';
7
+ mode?: "multipart" | "json-base64";
8
8
  rulesAsBase64?: boolean;
9
9
  }
10
10
  export declare function createRemoteEngine(opts: RemoteEngineOptions): Promise<YaraEngine>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pompelmi",
3
- "version": "0.34.9",
3
+ "version": "0.35.0",
4
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.",
5
5
  "main": "./dist/pompelmi.cjs",
6
6
  "module": "./dist/pompelmi.esm.js",
@@ -120,21 +120,21 @@
120
120
  "@pompelmi/core": "workspace:*",
121
121
  "@pompelmi/engine": "workspace:*",
122
122
  "@pompelmi/engine-heuristics": "workspace:^0.2.0",
123
- "@rollup/plugin-commonjs": "^28.0.6",
123
+ "@rollup/plugin-commonjs": "^29.0.2",
124
124
  "@rollup/plugin-node-resolve": "^16.0.1",
125
125
  "@rollup/plugin-typescript": "^12.1.4",
126
126
  "@types/cors": "^2.8.19",
127
127
  "@types/express": "^5.0.3",
128
128
  "@types/multer": "^2.0.0",
129
- "@types/node": "^24.3.0",
129
+ "@types/node": "^25.5.0",
130
130
  "@types/react": "^19.1.8",
131
131
  "@types/unzipper": "^0.10.11",
132
- "@vitest/coverage-v8": "^2",
132
+ "@vitest/coverage-v8": "^4",
133
133
  "cors": "^2.8.5",
134
134
  "depcheck": "^1.4.7",
135
135
  "express": "^5.1.0",
136
136
  "gh-pages": "^6.3.0",
137
- "knip": "^5.64.0",
137
+ "knip": "^6.1.1",
138
138
  "multer": "^2.0.2",
139
139
  "react": "^19.2.0",
140
140
  "rollup": "^4.x",
@@ -142,7 +142,7 @@
142
142
  "tslib": "^2.8.1",
143
143
  "tsup": "^8",
144
144
  "tsx": "^4.20.3",
145
- "typescript": "^5.9.2",
145
+ "typescript": "^6.0.2",
146
146
  "vitest": "2.1.9"
147
147
  },
148
148
  "peerDependencies": {