Practical LoRaWAN auditing and exploitation
Matias Sequeira (Security Researcher), Esteban Martinez Fayo (Director of Database Security · IOActive), Cesar Cerrudo (CTO · IOActive)
ZeroNights 2019 · Day 1
Overview
In this insightful ZeroNights presentation, Matias Sequeira, a Security Researcher, along with Esteban Martinez Fayo and Cesar Cerrudo from IOActive, delves into the critical security vulnerabilities prevalent in LoRaWAN networks. The talk, titled "Practical LoRaWAN auditing and exploitation," highlights how the widespread adoption of LoRaWAN for various Internet of Things (IoT) applications, from smart cities to industrial monitoring, introduces significant attack surfaces. The speakers meticulously dissect the protocol's security mechanisms, expose common implementation pitfalls, and demonstrate practical methods for both exploiting and defending against these weaknesses.

Key moments
- 0:00 Introduction to LoRaWAN: features and infrastructure
- 5:00 LoRaWAN v1.0.3: Core security features explained
- 12:40 Identified vulnerabilities in LoRaWAN v1.0.3
- 18:00 Real-world poor key management findings
- 22:00 Advanced LoRaWAN threats and attack vectors
- 26:00 Introducing the LoRaWAN Auditing Framework
- 34:00 Live demo: detecting attacks and cracking keys
- 38:00 Attacker scenarios and proposed solutions
Practical LoRaWAN auditing and exploitation
Speakers: Matias Sequeira (Security Researcher), Esteban Martinez Fayo (Director of Database Security, IOActive), Cesar Cerrudo (CTO, IOActive)
Conference: ZeroNights
YouTube: https://www.youtube.com/watch?v=t8SLfgoYRGs
Overview
In this insightful ZeroNights presentation, Matias Sequeira, a Security Researcher, along with Esteban Martinez Fayo and Cesar Cerrudo from IOActive, delves into the critical security vulnerabilities prevalent in LoRaWAN networks. The talk, titled "Practical LoRaWAN auditing and exploitation," highlights how the widespread adoption of LoRaWAN for various Internet of Things (IoT) applications, from smart cities to industrial monitoring, introduces significant attack surfaces. The speakers meticulously dissect the protocol's security mechanisms, expose common implementation pitfalls, and demonstrate practical methods for both exploiting and defending against these weaknesses.
The research underscores a pressing concern: while LoRaWAN promises low-power, long-range connectivity, its security often falls short in real-world deployments. The core of their findings revolves around poor key management practices and inherent design flaws in the widely deployed LoRaWAN 1.0.3 specification. By showcasing offensive tools and a custom-built auditing framework, IOActive provides a sobering look at the ease with which these networks can be compromised, leading to data manipulation, denial of service, and even potential physical risks.
This article provides a comprehensive analysis of the ZeroNights talk, detailing the technical underpinnings of LoRaWAN security, the specific vulnerabilities uncovered, the methodologies for exploitation, and, crucially, the defensive strategies proposed. It serves as a vital resource for network operators, IoT developers, and security professionals seeking to understand and mitigate the risks associated with LoRaWAN deployments.
Background
▶ Watch: Introduction to LoRaWAN: features and infrastructure (0:00)
LoRaWAN is a Low-Power Wide-Area Network (LPWAN) specification built upon the physical LoRa layer. It offers several compelling advantages that have driven its rapid adoption in the IoT space: exceptionally low power consumption (devices can operate for a year on two AA batteries), high range (up to 2.5 kilometers in urban areas and 10-15 kilometers in rural environments, with a record of 70 kilometers), and the use of unlicensed RF spectrum, eliminating the need for costly permits or licenses. The primary trade-off for these benefits is a low data rate, making it unsuitable for multimedia applications.
The basic LoRaWAN infrastructure comprises several key components: end devices (sensors, actuators), gateways (also known as Edwards), which act as a bridge between the LoRa radio technology and a TCP/IP stack, a network server responsible for authentication, authorization, and network management, and finally, application servers that define the specific IoT application logic.
LoRaWAN's growth has been explosive. The speakers note that there are now over 100 network operators globally, including major telecommunication companies, with a 60% growth rate in implementations last year. Projections indicate that by 2021, over 10 million devices are expected to be deployed annually, adding to the current count of approximately 80 million devices across more than 10,000 LoRaWAN networks worldwide. The LoRa Alliance, an organization dedicated to standardizing and improving the protocol, consists of over 65,000 developers, manufacturers, and vendors, including founding members like IBM and Semtech (the developer of the proprietary LoRa modulation). This extensive adoption underscores the critical importance of understanding and securing LoRaWAN deployments.
Key Findings
▶ Watch: Identified vulnerabilities in LoRaWAN v1.0.3 (12:40)
The central finding of this research is the pervasive vulnerability of LoRaWAN 1.0.3 networks, largely due to poor key management practices rather than inherent cryptographic weaknesses. The speakers demonstrate that AppKeys, the root keys used to derive session keys, are frequently exposed, easily guessable, or poorly managed across numerous deployments. This exposure allows attackers to compromise devices, inject malicious data, or perform denial-of-service attacks.
Specifically, the research highlights that:
- AppKeys are readily discoverable: They are often found on physical device tags, hardcoded in open-source firmware, exposed in mobile applications via Bluetooth Low Energy (BLE), shared in vendor Excel sheets, or even publicly discussed in online support forums.
- Weak and duplicated keys are common: Many deployments use "wiki keys" (e.g., all zeros, sequential patterns) or assign the same AppKey to large groups of devices, creating single points of failure.
- LoRaWAN 1.0.3 protocol flaws enable practical attacks: Issues like replay attacks, eavesdropping, bit-flipping, and spoofing of acknowledge messages are directly exploitable due to the protocol's design, particularly when session keys are reused or integrity checks are incomplete.
- The more secure LoRaWAN 1.1 is not widely adopted: Despite significant security enhancements, vendors and operators are slow to implement the newer version, leaving most deployments vulnerable to known attacks.
- Lack of auditing tools: Before this research, a significant gap existed in readily available open-source tools for auditing and pen-testing LoRaWAN networks, making it difficult for defenders to assess their security posture. To address this, the researchers developed a comprehensive framework for both offensive exploitation and defensive monitoring.
These findings collectively paint a picture of an IoT ecosystem where convenience and rapid deployment often overshadow fundamental security best practices, leaving critical infrastructure and sensitive data exposed.
Technical Deep Dive
▶ Watch: Advanced LoRaWAN threats and attack vectors (22:00)
LoRaWAN 1.0.3 incorporates several security features, though the research highlights their limitations in practice. Messages utilize 16-bit counters for both uplink (device to network server) and downlink (network server to device) traffic, ranging from 0 to 65,535 before resetting. Optional confirmed messages provide basic reliability. Integrity control is provided between the device and the network server using a Message Integrity Code (MIC), computed with the Network Session Key (NwkSKey). End-to-end encryption is implemented between the device and the application server for the data payload, using the Application Session Key (AppSKey).
The derivation of these session keys depends on the device activation method:
- Activation By Personalization (ABP): Session keys (NwkSKey and AppSKey) are pre-programmed into the device and network server. This method is explicitly discouraged for production environments as it fixes the cryptographic blocks, making replay and eavesdropping attacks easier if keys are ever compromised or reused without proper counter management.
- Over-The-Air Activation (OTAA): This is the recommended method. Session keys are dynamically generated each time the device resets through a Join Procedure, a handshake between the device and the network server. This procedure uses a root key called the AppKey, which is pre-shared. The device sends a Join Request message containing its Device Identifier (DevEUI) and a Device Nonce (DevNonce) (a random, never-used-once number to prevent replay attacks). The network server validates the device and responds with a Join Accept message, which includes a Device Address (DevAddr), an Application Nonce (AppNonce), and a Network Identifier (NetID). Crucially, this Join Accept message is encrypted using the AppKey. Once this exchange is complete, both the device and network server can derive unique NwkSKey and AppSKey for the session.
Integrity Control (MIC): The MIC is calculated by taking the entire LoRaWAN packet, computing an AES-CMAC hash (specifically, AES on CMAC mode taking 128-bit blocks), and then appending the first four bytes of this hash to the message. This process relies on the NwkSKey.
Confidentiality (Encryption): Only the data payload of the message is encrypted, while LoRaWAN headers are sent in plain text. Encryption uses AES in Counter (CTR) mode. An S-block is generated by encrypting a fixed block of bytes, the message counter, and the AppSKey. This S-block is then XORed with the data payload to produce the ciphertext. The direct dependency of the S-block on the message counter and AppSKey is a critical point for several vulnerabilities.
Vulnerabilities in LoRaWAN 1.0.3
The speakers identified several practical vulnerabilities stemming from the protocol's design and common implementation flaws:
- Replay Attack: Occurs when a device's 16-bit counter overflows and resets to zero, and the session keys are not regenerated (common with ABP or poorly implemented OTAA). An attacker can capture old messages and replay them. Since the AppSKey and the counter are reused, the same S-block is generated, making the replayed message cryptographically valid. This has two effects:
- The network server accepts stale data as current.
- It causes a Denial of Service (DoS) for the legitimate device. LoRaWAN mandates that network servers only accept messages with a higher counter than the last received. If an attacker replays a message with counter 10, and the legitimate device is at counter 50, the server will reject the device's subsequent messages (51-99) until its counter exceeds the replayed message's counter (e.g., 100).
- Eavesdropping: If an attacker captures a series of messages and knows some part of the application payload, they can deduce the AppSKey if it's being reused (similar conditions to replay attacks). The reuse of the S-block allows an attacker to guess bits of the payload, eventually decrypting the entire application data.
- Bit Flipping: LoRaWAN 1.0.3 does not define integrity between the network server and the application server. If an attacker gains access to the communication channel between these two components, they can flip bits in the encrypted payload. Since the application server receives the message from the network server without an integrity check, it will decrypt the corrupted data without notice, leading to incorrect information being processed by the end-user application.
- Spoofing Acknowledge Messages: LoRaWAN ACK messages do not specify which original message they are confirming. An attacker can capture a single ACK message and replay it to multiple devices, causing a Denial of Service by making devices believe their confirmed messages were received when they weren't, leading to retransmissions or other protocol-level confusion.
LoRaWAN 1.1 Enhancements and Adoption
LoRaWAN 1.1 significantly improves security by introducing a Join Server, separating the responsibilities of key management. Instead of one root AppKey, it uses two root keys, and the number of session keys increases from two to six. These changes mitigate many of the 1.0.3 vulnerabilities. However, the speakers lament that vendor adoption of LoRaWAN 1.1 is extremely slow, leaving a vast majority of deployed networks on the older, less secure version.
Key Management Issues – The Root Cause
The most critical finding is the pervasive poor key management in real-world LoRaWAN deployments:
- Physical Access: AppKeys are frequently found on physical tags attached to devices, hardcoded in open-source firmware (often default keys that are never changed), extracted from mobile applications that use Bluetooth Low Energy (BLE) for device provisioning, or provided in Excel sheets by vendors.
- "Wiki Keys": Many implementations use easily guessable or "well-known" keys, such as sequences of zeros, ones, or repetitive hexadecimal patterns (e.g.,
00...00,00...FF). - Duplicated Keys: A single AppKey is often used for an entire group or fleet of devices. Compromising one device's key thus compromises the entire group.
- Derivable Keys: Some AppKeys are derived from public data, such as information found in a Join Request message, making them predictable.
- Vendor Lock-in: Some vendors do not provide a mechanism to change the AppKey once programmed, forcing users to either trust a compromised device or discard it.
Other Emerging Threats
Beyond key management, the researchers identified other significant threats:
- Long-Range Packet Sniffing: The inherent long-range capability of LoRaWAN (2.5km in cities, 10-15km rural) allows attackers to capture traffic from a distance using relatively inexpensive gateways. The emergence of LoRaWAN gateways in space further exacerbates this, potentially allowing global traffic interception.
- Offline AppKey Cracking: With a captured Join Request and its corresponding Join Accept message, attackers can perform offline brute-force attacks to crack the AppKey. Even in LoRaWAN 1.1, one of the root keys remains vulnerable, potentially leading to DoS.
- Key Theft through Various Vectors: This includes reverse engineering devices, exploiting weaknesses in BLE provisioning, compromising manufacturers, vendors, telecom companies, technicians, or the network server itself.
- Denial of Service and Data Injection: These are the most direct and impactful threats. The ability to inject fake data or cause DoS can go undetected without active monitoring.
- Firmware Over-The-Air (FOTA) Attacks: LoRaWAN supports FOTA updates. An attacker could potentially leverage this mechanism to inject malicious firmware, such as ransomware, into devices.
Demo / Proof of Concept
▶ Watch: Introducing the LoRaWAN Auditing Framework (26:00)
The speakers developed a comprehensive set of tools, both offensive and defensive, to demonstrate and mitigate the identified vulnerabilities. The framework is predominantly written in Python 2, with some components in Golang, and utilizes SQLAlchemy for database access (supporting SQLite or PostgreSQL). It is distributed as a Docker container for ease of deployment.
Offensive Tools
The offensive suite consists of "micro-tools" designed for penetration testing LoRaWAN infrastructure:
- Traffic Sniffing: Tools to capture LoRaWAN packets using specialized hardware.
- Spoofing Join Traffic: Once an AppKey is obtained, attackers can spoof Join Requests and Join Accepts to derive session keys and then inject valid messages into the network.
- Fast Traffic Injection: Allows sending custom LoRaWAN packets to the network server.
- Key Cracking: Specifically targets AppKeys by analyzing captured Join Request and Join Accept pairs offline.
Defensive Tools (Auditing Framework)
The defensive component focuses on monitoring and detecting attacks:
- Message Collectors: Adaptable collectors for gathering LoRaWAN messages from various network servers (e.g., LoRa Server.io) and gateways. The framework is designed so that new collectors can be created with approximately 100 lines of Python code.
- Analyzers: These modules process collected data from the database to identify suspicious patterns and raise alerts. Current detection capabilities include:
- Join Replay Attacks: Detecting repeated DevNonce values.
- Replay Attacks / Data Injection: Identifying messages with unexpectedly low counters for a given device address, indicating potential spoofing or replay.
- ABP Activated Devices: Flagging devices using the less secure ABP method.
- Well-Known/Non-Random Keys: Checking against a dictionary of common AppKeys and identifying keys with predictable patterns (e.g.,
00...00,00...FF). The dictionary contains "more or less two thousand common keys." - Duplicated Sessions: Detecting instances where multiple entities are using the same session keys, indicating a potential key compromise and injection.
- Device Activity Monitoring: Simple checks to see how many devices are sending data.
Hardware Used
The research utilized specific hardware for sniffing and injection:
- Commercial LoRaWAN Gateway: A gateway costing approximately $200, composed of a transceiver and a filter. The researchers modified one of its software components (available on GitHub) to enable it to behave as a LoRaWAN device, allowing for injection of valid messages into a LoRaWAN infrastructure. Limitations included inability to sniff downlink traffic (crucial for Join Accept messages) and only supporting 8 out of 64 channels.
- Software-Defined Radio (SDR): To overcome the gateway's limitations, a LimeSDR Mini (costing approximately $300) was used. Its sufficient bandwidth allowed for comprehensive sniffing of all LoRaWAN channels and full downlink traffic capture, enabling AppKey cracking.
Demo Walkthrough
The live demo illustrated the framework's capabilities:
- Baseline Traffic: The researchers started with a database populated with normal LoRaWAN traffic captured in their lab.
- Attack Simulation: They then simulated an attack where an AppKey was stolen, session keys were derived, and fake packets were injected into the network.
- Analyzer Detection: Running the analyzers immediately raised alerts:
- Detection of a repeated DevNonce, indicating a Join Replay Attack.
- Detection of a "small counter" for a device address, signifying that the network server was receiving messages with counters lower than expected, confirming data injection or replay by an attacker.
- AppKey Brute-Forcing: The brute-forcer tool was then run on the captured traffic. It successfully identified the AppKey for a device by correlating a Join Request and Join Accept message, indicating the message ID in the database where the key was found.
- Post-Exploitation: With the AppKey, the demo showed how an attacker could retrieve session keys and then inject arbitrary fake data or perform a Denial of Service against the legitimate device.
Real-World Attack Scenarios
The speakers outlined critical real-world attack scenarios:
- Environmental Monitoring: Spoofing CO2 sensor data in a room to prevent an alarm, potentially endangering human lives.
- Smart Metering: Performing a DoS attack on millions of smart water or electricity meters. This would prevent utility companies from retrieving consumption data, making it impossible to charge bills at the end of the month, leading to significant economic disruption.
Defensive Implications
▶ Watch: Attacker scenarios and proposed solutions (38:00)
The research provides clear and actionable advice for defenders to secure their LoRaWAN deployments, categorized into key management improvements and active monitoring methods.
Key Management
The most critical area for improvement lies in key management:
- Utilize Secure Elements: Where economically feasible, integrate secure elements (specialized chips) into devices. These chips can securely store AppKeys and perform cryptographic operations internally, preventing direct key extraction. The main drawback is their cost, which may not be viable for all large-scale, low-cost deployments.
- Change Default Keys: Always replace vendor-provided default AppKeys with strong, unique, and randomly generated keys during device provisioning. Never rely on hardcoded defaults.
- Unique Keys Per Device/Group: Implement a policy of using unique AppKeys for each individual device. If grouping is necessary for management, ensure that groups are small and logically segmented, and that each group has a distinct AppKey. This prevents a single compromised key from affecting the entire network.
- Avoid Deriving Keys from Public Data: Never generate AppKeys using publicly accessible information (e.g., DeviceEUI, serial numbers, or data from Join Request messages), as this makes them easily predictable and crackable.
- Vendor Accountability: Pressure vendors to allow users to change AppKeys and to embrace LoRaWAN 1.1 for its enhanced security features.
Active Monitoring and Protocol Updates
Beyond key management, active measures are essential:
- Update and Audit LoRaWAN Networks: Regularly audit existing LoRaWAN deployments to identify devices using well-known AppKeys, older LoRaWAN versions, or ABP activation. Implement a strategy to migrate vulnerable devices or update their configurations.
- Deploy Third-Party Monitoring Solutions: Actively monitor LoRaWAN traffic using specialized software, such as the framework developed by the speakers. These tools can detect anomalies like repeated DevNonces, unexpected counter resets, or multiple sessions using the same keys, indicative of ongoing attacks. This allows for early detection of compromise and quicker response.
- Embrace LoRaWAN 1.1: While vendor adoption is slow, network operators should prioritize and push for the implementation of LoRaWAN 1.1. Its architectural improvements, including the Join Server and additional root/session keys, significantly enhance the protocol's resilience against many of the identified attacks.
By adopting these defensive strategies, organizations can significantly reduce their exposure to LoRaWAN-specific threats, protecting their IoT infrastructure and the critical data it handles.
Key Takeaways
- LoRaWAN 1.0.3 is inherently vulnerable: The widely deployed LoRaWAN 1.0.3 specification has significant security weaknesses, particularly concerning replay attacks, eavesdropping, and denial of service, exacerbated by its lack of end-to-end integrity.
- Poor key management is the primary exploit vector: The ease with which AppKeys can be discovered (physical tags, defaults, online leaks, Bluetooth LE) or guessed (weak/duplicated keys) is the most critical vulnerability, allowing attackers to compromise devices and inject malicious data.
- Attacks are practical and impactful: Demonstrated attacks like spoofing sensor data (e.g., CO2 levels) or causing widespread denial of service on smart meters pose real threats to human safety and critical infrastructure.
- Specialized tools are now available for auditing: The researchers developed open-source offensive (sniffing, spoofing, cracking) and defensive (collectors, analyzers for replay, weak keys, duplicate sessions) tools to help the community assess and secure LoRaWAN networks.
- LoRaWAN 1.1 adoption is crucial but slow: While LoRaWAN 1.1 addresses many security flaws, its limited deployment by vendors leaves most networks exposed, necessitating continued vigilance and proactive defensive measures.
- Proactive defense is essential: Defenders must prioritize changing default keys, using unique and strong AppKeys, and actively monitoring LoRaWAN traffic for anomalies to detect and prevent attacks.
About the Speaker(s)
The research presented in "Practical LoRaWAN auditing and exploitation" was a collaborative effort by security experts from IOActive. Matias Sequeira is a Security Researcher who led much of the technical deep dive and demonstration. He is actively involved in identifying and exploring vulnerabilities in various technologies. He was joined by Esteban Martinez Fayo, who serves as the Director of Database Security at IOActive, bringing extensive experience in securing critical data infrastructures. Cesar Cerrudo, the CTO of IOActive, also contributed to this research, leveraging his broad expertise in cybersecurity and his track record of uncovering significant vulnerabilities in diverse systems. Their collective work at IOActive focuses on providing advanced security research and services, contributing valuable insights to the cybersecurity community.
Reviews
Dr. Zero (Offensive Security Researcher) — SOLID
IOActive drops a much-needed auditing framework for LoRaWAN that turns theoretical protocol flaws into practical exploitation. The vulnerabilities aren't cryptographic rocket science—it's the usual IoT dumpster fire of hardcoded AppKeys and botched counter implementations—but Sequeira and crew actually did the work to operationalize the attacks.
Heather Calloway (CISO) — STRONG ACCEPT
This research exposes how the cheap, long-range IoT devices the business loves are quietly introducing massive integrity and availability risks. If you run physical operations, smart buildings, or OT, this is a mandatory watch for the team managing your IoT procurement and network monitoring.