You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Implement full XX pattern (TOFU) with identity binding
- Add NN pattern with explicit security warnings
- Add HandshakeQueue for async storage-backed handshakes
- Add secure-mem feature with LockedBytes (RAII mlock)
- Fix path normalization to prevent // in storage paths
- Align FFI mutex poisoning with availability-first strategy
- Regenerate Swift/Kotlin bindings
- Add fuzz targets for XX and NN patterns
- Fix docs to clarify reconnection is app-implemented
// Step 2: Server accepts and responds with identity
180
+
let (s_hs, response, server_pk) =server_accept_xx(&server, &init.first_msg)?;
181
+
182
+
// Step 3a: Client completes and learns server's key
183
+
let (result, final_msg) =client_complete_xx(&client, init.hs, &response, init.server_hint.as_deref())?;
184
+
185
+
// Step 3b: Server completes
186
+
let (s_link, client_id) =server_complete_xx(&server, s_hs, &final_msg, &server_pk)?;
187
+
188
+
// Pin server_pk for future IK connections!
189
+
save_pinned_key(result.server_static_pk);
190
+
```
191
+
192
+
### NN Pattern: Ephemeral-only (NO AUTHENTICATION)
193
+
194
+
> ⚠️ **Security Warning**: The NN pattern provides **forward secrecy only** with NO identity binding. An active attacker can trivially MITM this connection. Use ONLY when:
195
+
> - The transport layer provides authentication (e.g., TLS with pinned certs)
196
+
> - You are building a higher-level authenticated protocol on top
197
+
> - You explicitly accept the MITM risk for your use case
Copy file name to clipboardExpand all lines: THREAT_MODEL.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,8 +34,9 @@
34
34
│ └─────────────────────────────────────────┘ │
35
35
│ ┌─────────────────────────────────────────┐ │
36
36
│ │ Noise Protocol (via snow library) │ │
37
-
│ │ - XX pattern (first contact) │ │
38
37
│ │ - IK pattern (known server) │ │
38
+
│ │ - XX pattern (first contact/TOFU) │ │
39
+
│ │ - NN pattern (ephemeral-only)* │ │
39
40
│ └─────────────────────────────────────────┘ │
40
41
│ ┌─────────────────────────────────────────┐ │
41
42
│ │ Key Management (Ring/Pubky SDK) │ │
@@ -498,6 +499,41 @@ FFI errors are mapped to structured error codes:
498
499
499
500
---
500
501
502
+
### 5. NN Pattern (Ephemeral-Only) ⚠️ HIGH RISK
503
+
504
+
**CRITICAL WARNING**: The NN pattern provides **ZERO AUTHENTICATION**.
505
+
506
+
**Security Properties**:
507
+
- ✅ Forward secrecy (ephemeral keys)
508
+
- ❌ NO identity binding
509
+
- ❌ NO impersonation protection
510
+
- ❌ Trivial MITM attacks possible
511
+
512
+
**Attack Scenario**:
513
+
```
514
+
Client ←→ [Active Attacker] ←→ Server
515
+
```
516
+
An active attacker can:
517
+
1. Intercept client's ephemeral key
518
+
2. Complete handshake with client using attacker's ephemeral
519
+
3. Complete separate handshake with server using attacker's ephemeral
520
+
4. Decrypt all traffic, re-encrypt for the other party
521
+
522
+
**Valid Use Cases**:
523
+
- Transport layer already provides authentication (TLS with pinned certs)
524
+
- Building higher-level authenticated protocol on top
525
+
- Testing/development environments
526
+
- Explicit acceptance of MITM risk for specific use case
527
+
528
+
**NEVER Use For**:
529
+
- Production systems without external authentication
530
+
- Any system requiring identity verification
531
+
- Financial or sensitive data transfer
532
+
533
+
**Recommendation**: Use IK (known peer) or XX (TOFU) patterns instead. NN is included only for completeness and specific transport-layer integration scenarios.
0 commit comments