IoT Security Security of CoAP
IoT Security Security of CoAP
Security of CoAP
Mridul Sankar Barik
Jadavpur University
2024-25
Constrained Application Protocol (CoAP)
▶ A specialized web transfer protocol for use with constrained nodes and
constrained (e.g., low-power, lossy) networks [RFC 7252]
▶ Nodes often have 8-bit microcontrollers with small amounts of ROM and
RAM
▶ Constrained networks such as IPv6 over Low-Power Wireless Personal
Area Networks (6LoWPANs) often have high packet error rates and a
typical throughput of 10s of kbit/s
▶ Features
▶ Web protocol fulfilling M2M requirements in constrained environments
▶ UDP binding with optional reliability supporting unicast and multicast
requests
▶ Asynchronous message exchanges
▶ Low header overhead and parsing complexity
▶ URI and Content-type support
▶ Simple proxy and caching capabilities
▶ Security binding to Datagram Transport Layer Security (DTLS)
CoAP and HTTP
▶ Request-Response Model:
▶ A client sends a CoAP request to a
server, and the server responds with the
requested data or action
▶ Use of UDP (User Datagram Protocol):
▶ CoAP requests mirror those of HTTP, ▶ UDP is connectionless and requires less overhead
including GET, PUT, POST, and ▶ Offers three levels of reliability (Confirmable,
DELETE Non-Confirmable, and Acknowledgement) to cater to
▶ Simplifies interaction with resources, various use cases
making it suitable for both IoT
device-to-server communication and
machine-to-machine interactions
How Does CoAP Work? (2)
▶ Reverse Proxy
▶ Acts on behalf of the server.
▶ Clients send requests to the proxy, and it forwards them to the real server.
▶ Hides the server’s details and can be used for load balancing or firewall traversal.
▶ Cross-Protocol Proxy
▶ Translates between CoAP and another protocol, typically HTTP.
▶ Example: A client sends a CoAP request to a proxy that translates it into an HTTP
request to reach a web server.
Figure 1
CoAP Request/Response (1)
Blocking a Reply
Figure Source: [IETF, 2022]
Attacks on CoAP: The Request Delay Attack (1)
▶ An on-path attacker may not only block packets,
but can also delay the delivery of a selectively
chosen packet (request or response) by a chosen
amount of time
▶ If CoAP is used over an unreliable and unordered
transport such as UDP with DTLS or OSCORE,
other messages can be delivered before the
delayed message as long as the delayed packet is
delivered inside the replay window
▶ While an attacker selectively delaying a request to
a sensor is often not a security problem, an
attacker selectively delaying a request to an
actuator performing an action is often a serious
problem
▶ A request to an actuator (for example a request
to unlock a lock) is often only meant to be valid
for a short time frame, and if the request does
Delaying a Request not reach the actuator during this short
Figure Source: [IETF, 2022]
timeframe, the request should not be fulfilled.
▶ Using a replay window of length zero does not
solve this problem
Attacks on CoAP: The Request Delay Attack (2)
▶ Request Delay and Blocking Attacks can be used against block-wise transfers to
cause unauthorized operations to be performed on the server, and responses to
unauthorized operations to be mistaken for responses to authorized operations
▶ This attack works even if the individual request/response pairs are encrypted,
authenticated and protected against the Response Delay and Mismatch Attack
Attacks on CoAP: The Request Fragment Rearrangement
Attack (2)