Kuboid
Open Luck·Kuboid.in

Cash, Drugs, and Guns: Why Your Safes Aren't Safe

DEFCONConference74,691 views41:546 months ago

This talk demonstrates a hardware-level vulnerability in SecuRam electronic safe locks that allows for unauthorized access by extracting the master code via the debug port. The researchers reverse-engineered the lock's firmware and identified that the master code and encryption keys were stored in plaintext or easily decryptable flash memory. The attack, dubbed 'CodeSnatch', enables an attacker with physical access to bypass security controls and reset the safe's codes in seconds. The presentation highlights the critical failure of using insecure hardware design and outdated security standards in high-security physical products.

How to Extract Master Codes from SecuRam Safe Locks via Debug Port

TLDR: Researchers at DEF CON 2025 demonstrated that several popular SecuRam electronic safe locks store master codes and encryption keys in plaintext or easily decryptable flash memory. By accessing the Renesas RL78/G13 microcontroller via its debug port, an attacker can extract these credentials in under a second. This vulnerability, dubbed CodeSnatch, affects millions of safes used in residential, commercial, and pharmaceutical settings, highlighting a critical failure in physical security hardware design.

Physical security is often treated as a binary state: the door is either locked or it is not. We assume that if a manufacturer claims a product is "high-security" or "UL-certified," the underlying hardware has been vetted against common exploitation techniques. The research presented at DEF CON 2025 regarding SecuRam electronic locks proves that this assumption is dangerous. When a device designed to protect firearms, cash, and controlled substances relies on insecure microcontroller configurations, the entire security model collapses.

The CodeSnatch Vulnerability

The core of the issue lies in how SecuRam implements its firmware on the Renesas RL78/G13 microcontroller. During the research, it was discovered that the device's master code and the encryption keys used for internal communication are stored in the flash memory of the microcontroller.

The researchers found that the debug port, which is intended for factory programming and diagnostics, was left enabled in production units. Because the firmware does not implement a hardware security module or effective read-protection, an attacker with physical access can interface with this port to dump the entire contents of the flash memory.

The attack flow is straightforward:

  1. Remove the battery door to expose the PCB.
  2. Connect a custom tool (in this case, a Raspberry Pi Pico) to the "TOOL" pin, which functions as a bidirectional UART interface.
  3. Boot the processor into debug mode.
  4. Inject a small blob of code into the debug RAM to dump the flash memory contents.

This process takes less than a second. Once the flash is dumped, the master code is often visible in plaintext. Even when the manufacturer attempted to add "encryption" using the XXTEA symmetric cipher, the researchers found that the static 128-bit key was also stored in the flash memory right next to the encrypted data. This renders the encryption entirely ineffective against anyone who can read the flash.

Real-World Impact and Exposure

This is not a theoretical bug found in a lab. These locks are OEM components used by major safe manufacturers, including Liberty Safe, Fort Knox, and Rhino Metals. Furthermore, these same locks are deployed in high-stakes environments like pharmacies and hospitals to secure narcotics.

For a pentester, this represents a "game over" scenario for physical security assessments. If you encounter a safe secured by a SecuRam lock during an engagement, you do not need to spend hours attempting to manipulate the lock or brute-force the keypad. You only need the few seconds required to pop the battery cover and connect a standard microcontroller to the exposed header.

The OWASP Top 10 lists A02:2021-Cryptographic Failures and A07:2021-Identification and Authentication Failures as critical risks. This research is a textbook example of both. The manufacturer failed to protect sensitive authentication data and relied on "security through obscurity" by using a custom, weak encryption protocol with hardcoded keys.

Defensive Considerations

Defending against this requires a fundamental shift in how physical security hardware is designed. Manufacturers must move away from general-purpose microcontrollers that lack secure boot and hardware-based key storage. If a device is intended for high-security applications, the debug interfaces must be physically disabled or permanently fused after the manufacturing process.

For organizations currently using these locks, the mitigation options are limited. The researchers noted that some newer firmware versions have attempted to move the storage of codes, but the underlying architectural flaws remain. If you are responsible for the security of these devices, you should verify the manufacturing date of your locks and reach out to the vendor for an audit. If the lock supports a "recovery" feature, ensure that the default master codes have been changed and that the recovery process is strictly controlled.

Security researchers and hardware hackers should take note of the Fail0verflow blog, which provided much of the foundational work on the Renesas architecture used in this attack. Their research into the PS4, which utilized a similar processor, paved the way for this discovery. It serves as a reminder that the more widely a specific component is used, the larger the attack surface becomes. When a single microcontroller is used in everything from gaming consoles to pharmacy safes, a single vulnerability can have massive, cross-industry consequences.

The industry needs to stop treating physical security as a separate domain from digital security. A safe is just a computer with a heavy door, and if the computer is compromised, the door is already open.

Talk Type
research presentation
Difficulty
advanced
Has Demo Has Code Tool Released


DEF CON 33 Main Stage Talks

98 talks · 2025
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in