@svrnsec/pulse 0.7.0 → 0.8.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 (48) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +883 -782
  3. package/SECURITY.md +86 -86
  4. package/bin/svrnsec-pulse.js +7 -7
  5. package/dist/{pulse.cjs.js → pulse.cjs} +6378 -6419
  6. package/dist/pulse.cjs.map +1 -0
  7. package/dist/pulse.esm.js +6379 -6420
  8. package/dist/pulse.esm.js.map +1 -1
  9. package/index.d.ts +895 -846
  10. package/package.json +185 -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/fingerprint.js +475 -475
  36. package/src/index.js +342 -342
  37. package/src/integrations/react-native.js +462 -459
  38. package/src/integrations/react.js +184 -185
  39. package/src/middleware/express.js +155 -155
  40. package/src/middleware/next.js +174 -175
  41. package/src/proof/challenge.js +249 -249
  42. package/src/proof/engagementToken.js +426 -394
  43. package/src/proof/fingerprint.js +268 -268
  44. package/src/proof/validator.js +82 -142
  45. package/src/registry/serializer.js +349 -349
  46. package/src/terminal.js +263 -263
  47. package/src/update-notifier.js +259 -264
  48. package/dist/pulse.cjs.js.map +0 -1
package/SECURITY.md CHANGED
@@ -1,86 +1,86 @@
1
- # Security Policy
2
-
3
- ## Overview
4
-
5
- `@svrnsec/pulse` is a hardware-physics fingerprinting library used as a security layer.
6
- We take vulnerabilities seriously and will respond promptly.
7
-
8
- ## Supported Versions
9
-
10
- | Version | Supported |
11
- | ------- | ------------------ |
12
- | 0.1.x | ✅ Current release |
13
- | < 0.1 | ❌ No longer supported |
14
-
15
- ## Threat Model
16
-
17
- **What pulse protects against:**
18
- - Automated bots running in cloud VMs / Docker containers with no real hardware
19
- - Headless browser automation (Puppeteer, Playwright) on virtual machines
20
- - Credential-stuffing and account-takeover attacks from datacenter IP ranges
21
-
22
- **What pulse does NOT claim to protect against:**
23
- - A determined human attacker on real consumer hardware
24
- - A physical device farm (phones/laptops in a room)
25
- - Kernel-level hooks that spoof `performance.now()` at nanosecond precision
26
- - Server-side replay attacks when `checkNonce` is not wired (always wire it)
27
-
28
- ## Reporting a Vulnerability
29
-
30
- **Please do NOT open a public GitHub issue for security vulnerabilities.**
31
-
32
- Report security issues via email:
33
-
34
- > **security@sovereign.dev** *(or open a private GitHub Security Advisory)*
35
-
36
- ### What to include
37
-
38
- 1. A description of the vulnerability and the expected vs. actual behavior
39
- 2. Steps to reproduce (PoC code, scripts, or screenshots)
40
- 3. The impact — what can an attacker achieve?
41
- 4. Any suggested mitigation or fix
42
-
43
- ### Response SLA
44
-
45
- | Severity | Initial response | Target fix |
46
- |----------|-----------------|------------|
47
- | Critical | 24 hours | 7 days |
48
- | High | 48 hours | 14 days |
49
- | Medium | 5 business days | 30 days |
50
- | Low | 10 business days| Next minor |
51
-
52
- We follow [coordinated disclosure](https://en.wikipedia.org/wiki/Coordinated_vulnerability_disclosure).
53
- You will receive credit in the changelog unless you prefer to remain anonymous.
54
-
55
- ## Cryptographic Primitives
56
-
57
- - **Hashing**: BLAKE3 via `@noble/hashes` — audited, constant-time implementation
58
- - **Nonce generation**: `crypto.getRandomValues()` / Node.js `webcrypto` — 256 bits of entropy
59
- - **Webhook signatures**: HMAC-SHA256 — standard authenticated integrity check
60
-
61
- ## Known Limitations & Design Decisions
62
-
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.
76
-
77
- ## Secure Deployment Checklist
78
-
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
82
- - [ ] 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
85
- - [ ] Monitor `riskFlags` in webhook payloads for anomaly detection
86
- - [ ] Rotate `PULSE_API_KEYS` regularly; use different keys per environment
1
+ # Security Policy
2
+
3
+ ## Overview
4
+
5
+ `@svrnsec/pulse` is a hardware-physics fingerprinting library used as a security layer.
6
+ We take vulnerabilities seriously and will respond promptly.
7
+
8
+ ## Supported Versions
9
+
10
+ | Version | Supported |
11
+ | ------- | ------------------ |
12
+ | 0.1.x | ✅ Current release |
13
+ | < 0.1 | ❌ No longer supported |
14
+
15
+ ## Threat Model
16
+
17
+ **What pulse protects against:**
18
+ - Automated bots running in cloud VMs / Docker containers with no real hardware
19
+ - Headless browser automation (Puppeteer, Playwright) on virtual machines
20
+ - Credential-stuffing and account-takeover attacks from datacenter IP ranges
21
+
22
+ **What pulse does NOT claim to protect against:**
23
+ - A determined human attacker on real consumer hardware
24
+ - A physical device farm (phones/laptops in a room)
25
+ - Kernel-level hooks that spoof `performance.now()` at nanosecond precision
26
+ - Server-side replay attacks when `checkNonce` is not wired (always wire it)
27
+
28
+ ## Reporting a Vulnerability
29
+
30
+ **Please do NOT open a public GitHub issue for security vulnerabilities.**
31
+
32
+ Report security issues via email:
33
+
34
+ > **security@sovereign.dev** *(or open a private GitHub Security Advisory)*
35
+
36
+ ### What to include
37
+
38
+ 1. A description of the vulnerability and the expected vs. actual behavior
39
+ 2. Steps to reproduce (PoC code, scripts, or screenshots)
40
+ 3. The impact — what can an attacker achieve?
41
+ 4. Any suggested mitigation or fix
42
+
43
+ ### Response SLA
44
+
45
+ | Severity | Initial response | Target fix |
46
+ |----------|-----------------|------------|
47
+ | Critical | 24 hours | 7 days |
48
+ | High | 48 hours | 14 days |
49
+ | Medium | 5 business days | 30 days |
50
+ | Low | 10 business days| Next minor |
51
+
52
+ We follow [coordinated disclosure](https://en.wikipedia.org/wiki/Coordinated_vulnerability_disclosure).
53
+ You will receive credit in the changelog unless you prefer to remain anonymous.
54
+
55
+ ## Cryptographic Primitives
56
+
57
+ - **Hashing**: BLAKE3 via `@noble/hashes` — audited, constant-time implementation
58
+ - **Nonce generation**: `crypto.getRandomValues()` / Node.js `webcrypto` — 256 bits of entropy
59
+ - **Webhook signatures**: HMAC-SHA256 — standard authenticated integrity check
60
+
61
+ ## Known Limitations & Design Decisions
62
+
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.
76
+
77
+ ## Secure Deployment Checklist
78
+
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
82
+ - [ ] 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
85
+ - [ ] Monitor `riskFlags` in webhook payloads for anomaly detection
86
+ - [ ] Rotate `PULSE_API_KEYS` regularly; use different keys per environment
@@ -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));