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
Fix iOS BLE mesh authentication issues in BLEService (#998)
* Fix iOS BLE mesh authentication bypass chain in BLEService
- Bind sender IDs to BLE connection UUIDs for peripherals and centrals to prevent spoofing
- Enforce explicit RSR request/response validation and remove legacy TTL==0 RSR path
- Remove TTL==0 unconditional acceptance for messages and file transfers
- Ensure gossip sync caching only occurs after a packet is accepted
- Preserve self‑sync TTL==0 dedup exception without weakening authentication
* fix: toctou in boundPeerID identified by codex
* fix: Remove unused variable and bump version to 1.5.1
- Remove unused messageType variable (compiler warning fix)
- Bump marketing version to 1.5.1
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: jack <212554440+jackjackbits@users.noreply.github.com>
Co-authored-by: jack <jackjackbits@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
SecureLogger.warning("🚫 SECURITY: Sender ID spoofing attempt detected! Peripheral \(peripheralUUID.prefix(8))… claimed to be \(claimedSenderID.id.prefix(8))… but is bound to \(knownPeerID.id.prefix(8))…", category:.security)
2207
+
continue
2208
+
}
2209
+
trustedSenderID = knownPeerID
2210
+
}else{
2211
+
trustedSenderID =nil
2212
+
}
2213
+
2214
+
if !validatePacket(packet, from: trustedSenderID ?? claimedSenderID, connectionSource:.peripheral(peripheralUUID)){
2205
2215
continue
2206
2216
}
2217
+
2218
+
// If this is a direct-link announce, bind immediately for the remainder of this batch.
SecureLogger.warning("🚫 SECURITY: Sender ID spoofing attempt detected! Central \(centralUUID.prefix(8))… claimed to be \(claimedSenderID.id.prefix(8))… but is bound to \(knownPeerID.id.prefix(8))…", category:.security)
2647
+
continue
2648
+
}
2649
+
trustedSenderID = knownPeerID
2650
+
}else{
2651
+
trustedSenderID =nil
2652
+
}
2653
+
2654
+
if !validatePacket(packet, from: trustedSenderID ?? claimedSenderID, connectionSource:.central(centralUUID)){
2625
2655
continue
2626
2656
}
2627
-
2657
+
2628
2658
if packet.type !=MessageType.announce.rawValue {
2629
-
SecureLogger.debug("📦 Decoded (combined) packet type: \(packet.type) from sender: \(senderID)", category:.session)
2659
+
SecureLogger.debug("📦 Decoded (combined) packet type: \(packet.type) from sender: \(claimedSenderID)", category:.session)
2630
2660
}
2631
2661
if !subscribedCentrals.contains(sorted[0].central){
2632
2662
subscribedCentrals.append(sorted[0].central)
2633
2663
}
2634
2664
if packet.type ==MessageType.announce.rawValue {
2635
2665
if packet.ttl == messageTTL {
2636
-
centralToPeerID[centralUUID]=senderID
2666
+
centralToPeerID[centralUUID]=claimedSenderID
2637
2667
refreshLocalTopology()
2638
2668
}
2639
2669
// Record ingress link for last-hop suppression then process
0 commit comments