CVE-2024-29916
Executive Summary
CVE-2024-29916, known as the "Unsaflok" vulnerability, is a critical security flaw in the dormakaba Saflok electronic locking system. The vulnerability allows an attacker who possesses any single active or expired keycard for a specific property to forge keycards capable of unlocking arbitrary doors within that property. The root cause is a weak key derivation function that relies solely on a static UID (Unique Identifier) from the keycard, without incorporating any secret or dynamic data. This affects multiple Saflok series, including Saflok MT, Confidant, Quantum, RT, and Saffire. The vendor released a software update in November 2023 to address the issue, but the patch status for many installations remains unknown.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to software packages (NPM, PyPI, Go, Ruby). It is a hardware/firmware vulnerability in a physical access control system (PACS). The supply chain risk involves the physical distribution of keycards and the management of property-specific UIDs.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is likely a placeholder or uncalculated value. Based on the vulnerability description, a reasonable CVSS v3.1 vector would be:
- Attack Vector (AV): Physical (AV:P) - Requires physical access to a keycard and the lock.
- Attack Complexity (AC): Low (AC:L) - The attack is straightforward once a keycard is obtained.
- Privileges Required (PR): None (PR:N) - No authentication needed beyond the keycard.
- User Interaction (UI): None (UI:N) - No user action required.
- Scope (S): Changed (S:C) - The attacker can unlock doors beyond their authorized access.
- Confidentiality (C): High (C:H) - Unauthorized access to rooms.
- Integrity (I): High (I:H) - Ability to forge keycards.
- Availability (A): Low (A:L) - Could potentially lock out legitimate users.
Estimated CVSS Score: 7.6 (High)
Threat Level: Critical. The vulnerability allows physical bypass of access controls in hotels, universities, and other facilities using Saflok systems.
Deep Dive & Mechanics
The Saflok system uses a keycard with a magnetic stripe or RFID chip that stores a UID. The lock's firmware derives a key from this UID to authenticate the card. The vulnerability lies in the key derivation function (KDF), which uses only the UID as input. This means:
- Static Key: The derived key is the same for all cards with the same UID.
- No Secret: There is no master secret or per-property secret mixed into the KDF.
- Replay Attack: An attacker can read the UID from any valid card (active or expired) and create a new card with the same UID, which will be accepted by any lock in the property.
The attack does not require cryptographic breaking; it simply exploits the lack of entropy in the key derivation process. The November 2023 update likely introduces a more robust KDF that includes a property-specific secret or a rolling code mechanism.
Vulnerable vs. Patched Code
Since this is a firmware/hardware vulnerability, there is no traditional source code to compare. However, the conceptual difference is:
Vulnerable (Pre-November 2023):
# Simplified vulnerable key derivation
def derive_key(uid):
return hash(uid) # Only UID used
Patched (Post-November 2023):
# Simplified patched key derivation
def derive_key(uid, property_secret):
return hash(uid + property_secret) # Includes property-specific secret
The patched version introduces a property-specific secret that is not stored on the keycard, making it impossible to forge keys without knowledge of this secret.
Exploitation & Lab Setup
Red Team
Objective: Forge a keycard to unlock any door in a property.
Prerequisites:
- One active or expired keycard from the target property.
- A compatible keycard writer (e.g., Proxmark3 for RFID, or a magnetic stripe encoder).
- Physical access to the property's locks.
Steps:
- Obtain a Keycard: Acquire any valid keycard from the property (e.g., from a hotel room, lost and found, or expired card).
- Read UID: Use a card reader to extract the UID from the keycard.
- Write Forged Card: Program a blank card with the same UID using a card writer.
- Test: Approach any door with a Saflok lock and present the forged card. The lock should unlock.
Example using Proxmark3 (RFID):
# Read UID from a valid card
pm3 --> hf mf rdbl 0 A FFFFFFFFFFFF
# Write UID to a blank card
pm3 --> hf mf wrbl 0 A FFFFFFFFFFFF <UID>
Note: The exact commands depend on the card type (MIFARE, etc.) and the lock model.
Blue Team
Objective: Detect and prevent keycard forgery attacks.
Steps:
- Inventory Keycards: Track all issued keycards and their UIDs. Monitor for duplicate UIDs.
- Audit Logs: Enable and review lock audit logs for unusual access patterns (e.g., multiple doors opened by the same UID in a short time).
- Physical Inspection: Check for tampered locks or unauthorized card readers.
- Update Firmware: Apply the November 2023 software update from dormakaba.
- Implement Additional Controls: Use multi-factor authentication (e.g., PIN + card) where possible.
Indicators of Compromise (IOCs)
- Duplicate UIDs: Multiple keycards with the same UID in the system.
- Unusual Access Patterns: A single UID accessing multiple doors in a short period.
- Expired Card Usage: An expired keycard being used to unlock doors.
- Physical Tampering: Signs of card reader cloning devices near locks.
File-based IOCs (if applicable):
- None specific to this vulnerability.
Detection Engineering
YARA Rule
rule Detect_Saflok_Keycard_Forgery {
meta:
description = "Detects potential forged Saflok keycards by checking for duplicate UIDs in log files"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-29916"
strings:
$uid_pattern = /UID:\s*[A-F0-9]{8,16}/ nocase
condition:
#uid_pattern > 1
}
Sigma Rule
title: Saflok Keycard Forgery Detection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects multiple access events from the same UID in a short time window
author: Valters IT
date: 2024-01-01
logsource:
product: dormakaba_saflok
service: access_logs
detection:
selection:
EventID: 1001 # Example: Door Unlock Event
timeframe: 5m
condition:
selection | count() by UID > 5
falsepositives:
- Legitimate maintenance staff using a master keycard
level: high
Suricata Rule
alert tcp any any -> any 443 (msg:"CVE-2024-29916 Saflok Keycard Forgery Attempt"; flow:to_server; content:"|55 49 44|"; distance:0; within:10; classtype:attempted-admin; sid:1000001; rev:1;)
Note: This rule assumes network-based detection of keycard programming attempts (e.g., via a web interface). Adjust based on actual network traffic.
Remediation & Mitigation
- Immediate Action: Apply the November 2023 software update from dormakaba to all Saflok systems.
- Short-term Mitigation:
- Reissue all keycards with new UIDs after the update.
- Implement physical security controls (e.g., CCTV) near locks.
- Educate staff on the risk of lost or stolen keycards.
- Long-term Fix:
- Upgrade to a system with a robust key derivation function that includes a property-specific secret.
- Consider using rolling codes or public-key cryptography for keycard authentication.
- Monitoring:
- Enable and regularly review access logs.
- Set up alerts for duplicate UIDs or unusual access patterns.
Valters IT
Securing Your Digital Frontier