@svrnsec/pulse 0.7.0 → 0.9.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 (49) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +883 -782
  3. package/SECURITY.md +27 -22
  4. package/bin/svrnsec-pulse.js +7 -7
  5. package/dist/{pulse.cjs.js → pulse.cjs} +6428 -6413
  6. package/dist/pulse.cjs.map +1 -0
  7. package/dist/pulse.esm.js +6429 -6415
  8. package/dist/pulse.esm.js.map +1 -1
  9. package/index.d.ts +949 -846
  10. package/package.json +189 -184
  11. package/pkg/pulse_core.js +174 -173
  12. package/src/analysis/audio.js +213 -213
  13. package/src/analysis/authenticityAudit.js +408 -393
  14. package/src/analysis/coherence.js +502 -502
  15. package/src/analysis/coordinatedBehavior.js +825 -804
  16. package/src/analysis/heuristic.js +428 -428
  17. package/src/analysis/jitter.js +446 -446
  18. package/src/analysis/llm.js +473 -472
  19. package/src/analysis/populationEntropy.js +404 -403
  20. package/src/analysis/provider.js +248 -248
  21. package/src/analysis/refraction.js +392 -391
  22. package/src/analysis/trustScore.js +356 -356
  23. package/src/cli/args.js +36 -36
  24. package/src/cli/commands/scan.js +192 -192
  25. package/src/cli/runner.js +157 -157
  26. package/src/collector/adaptive.js +200 -200
  27. package/src/collector/bio.js +297 -287
  28. package/src/collector/canvas.js +247 -239
  29. package/src/collector/dram.js +203 -203
  30. package/src/collector/enf.js +311 -311
  31. package/src/collector/entropy.js +195 -195
  32. package/src/collector/gpu.js +248 -245
  33. package/src/collector/idleAttestation.js +480 -480
  34. package/src/collector/sabTimer.js +189 -191
  35. package/src/errors.js +54 -0
  36. package/src/fingerprint.js +475 -475
  37. package/src/index.js +345 -342
  38. package/src/integrations/react-native.js +462 -459
  39. package/src/integrations/react.js +184 -185
  40. package/src/middleware/express.js +155 -155
  41. package/src/middleware/next.js +174 -175
  42. package/src/proof/challenge.js +249 -249
  43. package/src/proof/engagementToken.js +426 -394
  44. package/src/proof/fingerprint.js +268 -268
  45. package/src/proof/validator.js +82 -142
  46. package/src/registry/serializer.js +349 -349
  47. package/src/terminal.js +263 -263
  48. package/src/update-notifier.js +259 -264
  49. package/dist/pulse.cjs.js.map +0 -1
package/SECURITY.md CHANGED
@@ -9,8 +9,8 @@ We take vulnerabilities seriously and will respond promptly.
9
9
 
10
10
  | Version | Supported |
11
11
  | ------- | ------------------ |
12
- | 0.1.x | Current release |
13
- | < 0.1 | No longer supported |
12
+ | 0.8.x | :white_check_mark: Security fixes + active development |
13
+ | < 0.8 | :x: Deprecated critical security vulnerabilities. Upgrade immediately. |
14
14
 
15
15
  ## Threat Model
16
16
 
@@ -18,12 +18,18 @@ We take vulnerabilities seriously and will respond promptly.
18
18
  - Automated bots running in cloud VMs / Docker containers with no real hardware
19
19
  - Headless browser automation (Puppeteer, Playwright) on virtual machines
20
20
  - Credential-stuffing and account-takeover attacks from datacenter IP ranges
21
+ - Click farms (via proof-of-idle thermal cooling analysis)
22
+ - LLM-controlled browser agents (via behavioral biometrics)
23
+ - Coordinated inauthentic behavior (via population-level statistical analysis)
24
+ - Proof replay attacks (via HMAC-signed challenges + atomic nonce consumption)
25
+ - Payload tampering (via BLAKE3 commitment integrity)
21
26
 
22
27
  **What pulse does NOT claim to protect against:**
23
28
  - A determined human attacker on real consumer hardware
24
- - A physical device farm (phones/laptops in a room)
29
+ - A physical device farm where each device genuinely cools between interactions
25
30
  - Kernel-level hooks that spoof `performance.now()` at nanosecond precision
26
31
  - Server-side replay attacks when `checkNonce` is not wired (always wire it)
32
+ - GPU passthrough VMs with native hardware clock access
27
33
 
28
34
  ## Reporting a Vulnerability
29
35
 
@@ -55,32 +61,31 @@ You will receive credit in the changelog unless you prefer to remain anonymous.
55
61
  ## Cryptographic Primitives
56
62
 
57
63
  - **Hashing**: BLAKE3 via `@noble/hashes` — audited, constant-time implementation
64
+ - **Challenge signing**: HMAC-SHA256 over `nonce|issuedAt|expiresAt` with timing-safe comparison
65
+ - **Engagement tokens**: HMAC-SHA256 over fraud-relevant fields with 30-second TTL
58
66
  - **Nonce generation**: `crypto.getRandomValues()` / Node.js `webcrypto` — 256 bits of entropy
59
67
  - **Webhook signatures**: HMAC-SHA256 — standard authenticated integrity check
68
+ - **API key comparison**: `crypto.timingSafeEqual` — constant-time to prevent timing attacks
60
69
 
61
- ## Known Limitations & Design Decisions
70
+ ## Privacy
62
71
 
63
- ### Score, not binary gate
64
- The jitter score is a continuous value `[0, 1]`. Applications must choose their own
65
- threshold (`minJitterScore`). A score of `0.55` (default) is conservative; financial
66
- applications may want `0.70+`.
67
-
68
- ### No raw data leaves the browser
69
- The server receives only a ~1.6 KB statistical summary (means, variances, percentiles).
70
- Raw timing arrays and mouse coordinates stay on device. This is intentional — it
71
- limits what a compromised server can learn about the client.
72
-
73
- ### Registry is additive
74
- The VM classification registry (which vendor a VM is from) is separate from detection.
75
- A VM can be detected by physics even if its vendor is not in the registry.
72
+ - Raw timing arrays never leave the device — server receives only a ~1.6 KB statistical summary
73
+ - Mouse coordinates are never stored only timing deltas between events
74
+ - Keystrokes capture only dwell/flight times key labels are discarded immediately
75
+ - `hardwareId()` is a 128-bit BLAKE3 hash — stable per device, not reversible, not cross-origin linkable
76
+ - No IP addresses are logged by default — integrators should implement their own IP handling policy
76
77
 
77
78
  ## Secure Deployment Checklist
78
79
 
79
- - [ ] Set `NODE_ENV=production` to disable verbose error messages
80
- - [ ] Wire `checkNonce` to a Redis `SET NX` with TTL to prevent replay attacks
81
- - [ ] Set `PULSE_WEBHOOK_SECRET` to a cryptographically random 32+ character string
80
+ - [ ] Set `NODE_ENV=production` to enforce secret validation at startup
81
+ - [ ] Set `PULSE_CHALLENGE_SECRET` to a cryptographically random 64-char hex string
82
+ - [ ] Set `WEBHOOK_SECRET` to a separate cryptographically random string
83
+ - [ ] Wire `checkNonce` to Redis `DEL` (returns 1 on first use) for atomic replay prevention
84
+ - [ ] Set `REDIS_URL` for multi-instance deployments (in-memory store is single-instance only)
82
85
  - [ ] Put the API server behind TLS (nginx / Caddy / ALB)
83
- - [ ] Set `PULSE_CORS_ORIGINS` to your exact domain — not `*`
84
- - [ ] Set `minJitterScore` 0.65 for high-value endpoints
86
+ - [ ] Set `CORS_ORIGINS` to your exact domain — not `*`
87
+ - [ ] Set `minJitterScore` >= 0.65 for high-value endpoints
85
88
  - [ ] Monitor `riskFlags` in webhook payloads for anomaly detection
89
+ - [ ] Use `/health/ready` (not `/health`) for load balancer health checks
86
90
  - [ ] Rotate `PULSE_API_KEYS` regularly; use different keys per environment
91
+ - [ ] Review `webhook.dead_letter` log events for delivery failures
@@ -1,7 +1,7 @@
1
- #!/usr/bin/env node
2
- /**
3
- * svrnsec-pulse CLI
4
- * Usage: npx svrnsec-pulse <command> [options]
5
- */
6
- import { run } from '../src/cli/runner.js';
7
- run(process.argv.slice(2));
1
+ #!/usr/bin/env node
2
+ /**
3
+ * svrnsec-pulse CLI
4
+ * Usage: npx svrnsec-pulse <command> [options]
5
+ */
6
+ import { run } from '../src/cli/runner.js';
7
+ run(process.argv.slice(2));