"Open, Sesame!" - unlocking Bluetooth padlocks with polite requests
Miłosz Gaczkowski (Mobile Security Specialist · WithSecure), Alex Pettifer
Security BSides London 2023 · Day 1 · Clappy Monkey Track
Overview
In "Open, Sesame!" - unlocking Bluetooth padlocks with polite requests, Miłosz Gaczkowski, Mobile Security Lead at WithSecure, and Alex Pettifer, a WithSecure intern, exposed critical security vulnerabilities in a popular line of Bluetooth-enabled smart padlocks. The talk detailed how widely available devices, marketed under various brands like eLink Smart, Anwell, and EC Smart, could be unlocked with minimal effort due to a combination of easily exploitable API flaws and weak Bluetooth Low Energy (BLE) communication security.

Key moments
- 2:00 Project goals: BLE reverse engineering and mobile app security
- 6:00 Why e-link smart padlocks were chosen for analysis
- 13:30 How a hardcoded encryption key was found in the app
- 19:00 Critical API flaw allows retrieving unlock codes for any lock
- 22:00 Successful live demonstration of the unlock attack
- 24:30 API allows enabling and viewing unlock locations remotely
- 28:30 Attempts to contact vendor and their brief, undone security update
- 32:00 Final conclusions: don't buy these, get into IoT security
"Open, Sesame!" - unlocking Bluetooth padlocks with polite requests
Speakers: Miłosz Gaczkowski, Mobile Security Specialist, WithSecure; Alex Pettifer
Conference: BSides London
YouTube: https://www.youtube.com/watch?v=1JDqhzQCtAA
Overview
In "Open, Sesame!" - unlocking Bluetooth padlocks with polite requests, Miłosz Gaczkowski, Mobile Security Lead at WithSecure, and Alex Pettifer, a WithSecure intern, exposed critical security vulnerabilities in a popular line of Bluetooth-enabled smart padlocks. The talk detailed how widely available devices, marketed under various brands like eLink Smart, Anwell, and EC Smart, could be unlocked with minimal effort due to a combination of easily exploitable API flaws and weak Bluetooth Low Energy (BLE) communication security.
The presentation, originating from an intern project exploring BLE and mobile application reverse engineering, serves as a stark warning against placing trust in unverified smart devices. Gaczkowski and Pettifer demonstrated that these locks, despite offering convenience features like fingerprint and remote app-based unlocking, fundamentally fail to provide even rudimentary digital security. Their findings underscore a pervasive issue within the Internet of Things (IoT) landscape, where basic security principles are often neglected in favor of functionality and market speed.
The significance of this research extends beyond the specific padlocks examined. It highlights a critical cross-section of physical and mobile application security, demonstrating how a seemingly robust physical security device can be rendered useless by software vulnerabilities. The ease with which an attacker can obtain the master passkey for any lock, without authentication, transforms a security device into a mere novelty, capable of being opened by anyone with a basic understanding of the attack vector.
Background
▶ Watch: Project goals: BLE reverse engineering and mobile app security (2:00)
The project began as an initiative to build experience in Bluetooth Low Energy (BLE) communication and mobile application reverse engineering. The speakers selected specific smart padlocks because of their prominent presence on Amazon UK, where they consistently ranked high in search results for "Bluetooth smart padlock." This market visibility, coupled with extensive advertising on platforms like German television and popularity in various European marketplaces, suggested a significant user base, making them a high-impact target for security research. The chosen locks, though branded differently, shared common underlying hardware and software from a Chinese manufacturer, eLink Smart.
Functionally, these padlocks offered local fingerprint authentication and remote unlocking via a mobile application using BLE. Some models also included a traditional keyway, though the focus of the research was on their smart capabilities. An amusing, yet prophetic, warning found on the packaging stated: "Please register first experience mode anyone can unlock." While intended to explain default behavior before setup, it inadvertently foreshadowed the core vulnerability discovered by the researchers. The inherent design of these "smart" features, requiring connectivity and mobile app interaction, created the attack surface that the researchers meticulously explored. The problem fundamentally arises from a lack of secure development practices and an apparent absence of security testing or regulatory oversight for such consumer IoT devices.
Key Findings
▶ Watch: How a hardcoded encryption key was found in the app (13:30)
The research uncovered a series of severe vulnerabilities that collectively rendered the smart padlocks effectively insecure:
- Hardcoded Encryption Key: The Bluetooth Low Energy (BLE) communication between the mobile application and the padlock was encrypted using AES (Advanced Encryption Standard), specifically a block cipher. However, the symmetric encryption key was found to be hardcoded directly within the mobile application. This meant that once extracted through reverse engineering, the key could be used to decrypt all past and future communications to and from any of these padlocks, nullifying the purpose of encryption.
- Static Passkeys: Each padlock utilized a six-digit decimal passkey for unlocking via BLE. Crucially, this passkey was found to be static and never changed, even after factory resets or re-pairing with different mobile devices. This persistent passkey became a permanent master key for the lock once discovered.
- Unauthenticated API Endpoint for Passkey Disclosure: The most critical vulnerability lay within the vendor's cloud API. The mobile application would query an endpoint,
POST /api/get lock info by Mac, to retrieve the unlock passkey for a specific lock. This API endpoint required only the MAC address of the lock (which is publicly broadcast by the BLE device) and ignored other parameters likeusernameorsession token. This allowed any attacker to query the API and receive the static six-digit passkey for any lock, simply by knowing its MAC address, without any form of authentication or authorization.
- Replay Attack Feasibility: Although the BLE communication included a "login token" (a temporary random number) intended to prevent direct replay attacks, this token could be easily obtained from the lock itself without authorization. With the hardcoded AES key and the static passkey obtained from the API, an attacker could construct a valid unlock command with a freshly requested token, effectively performing a replay attack with minimal effort.
- Location Tracking and Log Disclosure: The API also exposed other highly sensitive information. An endpoint to
List locks owned by a userwas vulnerable to user ID enumeration, allowing an attacker to list all locks associated with a user. Furthermore, theget unlock logendpoint returned a full history of all unlock events for any lock, including precise latitude and longitude coordinates if the optional location tracking feature was enabled. Critically, enabling this location tracking feature for any lock also required no authentication or authorization, allowing an attacker to remotely activate it and then track the physical location of a padlock.
- Vendor Non-Responsiveness and Flawed Remediation: Despite repeated attempts to contact the manufacturer (eLink Smart) with detailed vulnerability reports, the researchers received no response. A brief, unexplained update to the API and mobile application occurred in late October, introducing a partial and flawed authentication mechanism that still lacked proper authorization. This "fix" was then reverted a month later, leaving the system as vulnerable as before, suggesting either incompetence, a lack of resources, or a deliberate decision to prioritize functionality over security.
Technical Deep Dive
▶ Watch: Successful live demonstration of the unlock attack (22:00)
The technical investigation into the eLink Smart padlocks involved a multi-pronged approach, combining Bluetooth Low Energy (BLE) sniffing, mobile application reverse engineering, and HTTPS API interception.
BLE Communication Analysis
The initial phase focused on understanding the BLE communication between the mobile application and the padlock.
- Tools: The researchers utilized a Nordic Semiconductor NRF 52840 dongle loaded with proprietary sniffing software, which integrated seamlessly with Wireshark. This setup provided granular visibility into the BLE packets exchanged.
- Observations: Captured packets exhibited several key characteristics:
- Each packet began with a consistent byte indicating the total length of the subsequent data.
- The data payloads appeared highly random.
- Critically, all data messages were consistently an exact multiple of 16 bytes long.
- Conclusion: The fixed 16-byte block size strongly suggested the use of a block cipher, specifically AES (Advanced Encryption Standard), for encrypting the communication. This immediately indicated that to understand the protocol, decryption was necessary, which in turn required finding the encryption key.
Mobile Application Reverse Engineering
To find the encryption key, the team turned to the mobile application itself.
- Tools: The Jadx decompilation tool was employed to convert the Android application's bytecode back into a human-readable Java-like format.
- Challenge: The application was heavily obfuscated. Function names and variable names were replaced with single-character identifiers (e.g.,
c.n.a.f.dog), making initial comprehension extremely difficult. - Breakthrough: A custom logging library embedded within the application proved invaluable. This library used a consistent logging format, typically
class.method.variable, often including descriptive messages. By searching for keywords related to BLE or security, the researchers identified a log message:blle protocol yous and package unlock Cloud PWD. This specific log entry provided a critical anchor point, indicating a function responsible for handling the unlock command and likely dealing with a password (PWD). - Key Discovery: Following these deobfuscated clues, the researchers located an
encryptDatafunction. Investigation into this function revealed that it consistently used the same hardcoded symmetric key for all encryption operations. This key was present directly within the application's code, accessible to anyone who could decompile the app. The use of a symmetric key meant the same key was used for both encryption and decryption, confirming that once found, all communications could be read.
Decrypted BLE Packet Structure
After decrypting the BLE packets using the extracted key, a consistent structure emerged:
- Total Length: The initial byte indicating the overall length of the packet.
- Command Code: A specific byte sequence dictating the action the lock should perform (e.g., "unlock," "add new fingerprint").
- Login Token: A random number negotiated during the initial connection to the lock. This was intended to prevent simple replay attacks (sending the exact same sniffed packet again). However, this token could be requested from the lock without any prior authorization, making it trivial for an attacker to obtain a valid current token.
- ASCII-Encoded Passkey: The six-digit decimal passkey, encoded in ASCII, which directly commanded the lock to open.
HTTPS API Interception and Analysis
With the understanding that the passkey was static and the phone knew it, the next logical step was to investigate how the phone obtained this passkey. This led to intercepting the application's HTTPS communications.
- Tools: Burp Suite was used to proxy the mobile application's web traffic. Setting up a phone to route through Burp Suite is a standard mobile application security technique.
- Discovery: The researchers identified a crucial POST request to the API endpoint:
/api/get lock info by Mac. - Request Parameters: The request included several parameters:
MAC address: The hardware address of the lock, which is publicly broadcast via BLE.username: The user's account name.session token: An authentication token.type=2andcp=El: Ununderstood parameters, likely related to branding or internal API logic.- Critical Finding: Through experimentation, the researchers discovered that the
usernameandsession tokenparameters were completely ignored by the API. Any random gibberish or even their complete absence did not prevent the API from responding. The only required parameter was the MAC address of the target lock. - API Response: The API's response was equally revealing. It confirmed success (e.g.,
state: "successful", a Mandarin Chinese success message), reiterated the MAC address, and most importantly, returned the six-digit passcode for the requested lock (e.g.,passcode: "49625").
This complete lack of authentication and authorization on the API endpoint meant that an attacker only needed the publicly available MAC address of a lock to retrieve its permanent unlock passkey. This single flaw completely undermined any perceived security of the device.
Additional API Vulnerabilities
Beyond the passkey disclosure, further API exploration uncovered:
- User Enumeration: An endpoint to
List locks owned by a useraccepted auser IDas an argument, which was found to be an sequential, enumerable number. This allowed an attacker to systematically list all locks associated with any user. - Unlock Log and Location Tracking Disclosure: The
get unlock logendpoint, when provided with a lock ID (obtained via user enumeration), returned a complete history of all unlock events. If the lock's optional location tracking feature was enabled, this log included latitude and longitude coordinates of each unlock. Crucially, the API also allowed an unauthenticated attacker to remotely enable this location tracking feature for any lock. This created a potential for malicious actors to track the physical location of locks and then unlock them using the previously obtained passkey.
Demo / Proof of Concept
▶ Watch: API allows enabling and viewing unlock locations remotely (24:30)
Alex Pettifer developed a Python proof-of-concept (PoC) script that encapsulated all the discovered vulnerabilities into an automated attack. The script performed the following actions:
- Scan for BLE Devices: It scanned the local environment for nearby Bluetooth Low Energy devices, filtering specifically for those with the known eLink OUI (Organizationally Unique Identifier), which identifies the manufacturer. This allowed the script to discover the MAC addresses of vulnerable locks in the vicinity.
- Retrieve Passkey from API: For each identified lock, the script made an unauthenticated HTTP POST request to the
get lock info by MacAPI endpoint, using the lock's MAC address. The API, as discovered, responded with the static six-digit unlock passkey. - Connect and Obtain Token: The script then connected to the target Bluetooth padlock and requested a new, temporary "login token" from the device. This step required no authentication.
- Construct and Send Unlock Command: Finally, the script constructed a BLE packet using the hardcoded AES encryption key, the newly obtained login token, and the passkey retrieved from the API. This encrypted command was then sent to the padlock.
- Lock Unlocks: Upon receiving the valid command, the padlock registered it as a legitimate unlock request and physically opened.
During the live demonstration at BSides London, Miłosz Gaczkowski bravely executed the PoC script on stage, placing his laptop very close to several eLink Smart padlocks. The script successfully detected four locks, queried the API for their respective passkeys, and then, one by one, issued the unlock commands. The audience witnessed the padlocks audibly click open, confirming the severe and practical nature of the vulnerabilities. The speakers mentioned having a pre-recorded backup video, but the live demonstration proceeded without issues, underscoring the reliability of their findings.
Defensive Implications
▶ Watch: Final conclusions: don't buy these, get into IoT security (32:00)
The implications of these findings for users and the broader IoT security landscape are significant. Given the fundamental design flaws, several defensive strategies were proposed, ranging from user-level mitigations to broader industry calls for change.
User-Level Mitigations
For existing owners of these eLink Smart (or rebranded) padlocks, the options are limited but crucial:
- Avoid Sensitive Use: The primary recommendation is to never use these padlocks for securing anything of value or importance. Their digital security is non-existent, making them unsuitable for any real-world security application.
- Fingerprint-Only Mode: The locks offer a fingerprint-only mode, which disables the Bluetooth functionality. While this removes the remote unlock vulnerability, entering this mode is reportedly difficult, requiring specific sequences of unpairing, long presses, and multiple fingerprint touches. Even in this mode, the physical security of the locks remains questionable, as they are not designed for high-security applications and can be bypassed with physical tools.
- Gutting or Disposal: A more drastic but effective measure is to disassemble the locks and remove their "smart" components, effectively turning them into basic, albeit still low-security, mechanical padlocks. Alternatively, users should simply dispose of them, as their inherent vulnerabilities make them a liability rather than a security device.
Vendor Non-Responsiveness and Broader Industry Issues
The researchers made extensive efforts to engage with the manufacturer, eLink Smart, following responsible disclosure principles:
- Initial Contact: Communication began on September 1st, involving a detailed email explaining the vulnerabilities and proposed fixes.
- Repeated Unanswered Outreach: Despite multiple follow-ups, attempts to reach various points of contact (including a data protection enforcer and even a social media manager), and re-explaining the issues, the vendor provided no response whatsoever.
- Brief and Reverted "Fix": Intriguingly, around October 24th, the API and mobile application received an update. For a period of about two weeks, the API requests began requiring some form of authentication, though it was still flawed (e.g., allowing login as any user without proper authorization). However, this partial "fix" was mysteriously reverted a month later, returning the system to its original, completely unauthenticated state. The researchers hypothesized that the temporary authentication might have broken some functionality in the app, leading the vendor to casually disable it rather than properly fix it.
- Public Disclosure: Due to the complete lack of vendor engagement and the severe, unresolved nature of the vulnerabilities, the researchers proceeded with public disclosure through their conference talk and an upcoming blog post. They also appealed to the audience for assistance in bridging potential cultural or language barriers with the Chinese-based vendor, suggesting that communication issues might be a factor in the non-response.
This experience highlights a systemic problem in the IoT market: a lack of accountability and incentive for manufacturers to prioritize security. Without industry standards, regulations, or consumer demand for secure products, vendors of cheap IoT devices often cut corners, leading to easily exploitable flaws. The speakers expressed pessimism that other smart padlock brands would fare much better, suggesting many might use similar underlying components or development practices.
Call to Action for the Security Community
The talk concluded with a powerful call to action for the security community:
- Increased Scrutiny: More security professionals should apply their skills to scrutinize IoT devices. The skill set required (BLE analysis, mobile app reverse engineering, API interception) is accessible but currently underutilized in this domain.
- Breaking Stuff for Fun and Security: Encouraging researchers to "go and hack some locks and other IoT devices" is not just for entertainment but is a necessary step to expose flaws and pressure manufacturers to improve security. This proactive approach is crucial in a market where security is often an afterthought.
Key Takeaways
- These popular Bluetooth smart padlocks (eLink Smart, Anwell, EC Smart) are fundamentally insecure due to a combination of severe API and BLE vulnerabilities.
- The most critical flaw is an unauthenticated API endpoint that reveals the static, six-digit unlock passkey for any lock, requiring only its publicly broadcast MAC address.
- BLE communication, though encrypted with AES, uses a hardcoded symmetric key embedded in the mobile application, rendering the encryption ineffective against a determined attacker.
- Users should avoid purchasing these locks for any security-sensitive applications. Existing owners are advised to utilize the difficult-to-enable fingerprint-only mode (losing smart functionality), physically modify them, or dispose of them entirely.
- The vendor demonstrated a complete lack of responsiveness to responsible disclosure attempts, and a brief, flawed attempt at a security fix was inexplicably reverted, highlighting a systemic disregard for user security.
- This research serves as a stark reminder of the prevalent security deficiencies in the consumer IoT market and a call for increased scrutiny and reverse engineering efforts by the security community to expose similar widespread flaws.
About the Speaker(s)
Miłosz Gaczkowski is the Mobile Security Lead at WithSecure. In his past, he dedicated time to teaching computer science and cyber security. At WithSecure, his primary focus is on the security of Android and iOS applications, as well as Android devices. He is also known for his enjoyment of obscure power metal and the color purple.
Alex Pettifer was an intern at WithSecure at the time of this talk. A former student, he expressed a love for locks and rats, and this presentation marked his very first appearance as both an attendee and a speaker at a BSides conference.
Reviews
Dr. Zero (Offensive Security Researcher) — SOLID
Another day, another white-label IoT vendor shipping e-waste with hardcoded AES keys. Gaczkowski and Pettifer did exactly what you're supposed to do with this garbage: ripped it apart, documented the disaster, and live-demoed the exploit on stage.
Heather Calloway (CISO) — SOLID
No one is securing a Fortune 100 datacenter with a cheap Amazon smart lock. But your regional facility managers are absolutely expensing these for branch office IT closets and document bins. This technical teardown proves why physical security hardware can no longer bypass IT procurement reviews.