← Back to the chapter · Previous detail

Technical detail · CoAP DTLS/OSCORE Security

OSCORE replay-test mechanics after restart

A CoAP restart-recovery test must distinguish replay rejection from duplicate handling and acceptance of newly protected valid requests.

The experiment captures the outer protected CoAP request before Datagram Transport Layer Security (DTLS) connection encryption and replays it through valid transport so transport rejection does not mask the content-security check. Its harness changes only the outer Message ID, the CoAP field used for acknowledgement and duplicate handling, to reach Object Security for Constrained RESTful Environments (OSCORE) replay validation while preserving the OSCORE option, the CoAP metadata field marking protected-content processing, and protected content. Duplicate-cache handling or a transport error alone leaves replay validation untested.

The context’s keys, sender sequence state and recipient replay state must be assessed together. If restart retains the security context, require replay-check rejection and no second application operation. If it replaces the context, obsolete-context rejection does not prove persistence of the old replay window. Test any old context that remains usable. A second application operation from the captured request shows replay failure, even when new protected traffic succeeds. Keep secrets and sensitive plaintext out of the record, and record unauthorized-credential rejection separately.

← Back to the chapter · Previous detail