Safeguard
Vulnerability Analysis•

CVE-2021-42141: Critical Handshake Flaw in tinyDTLS

CVE-2021-42141 is a critical DTLS handshake flaw in Contiki-NG tinyDTLS, scored 9.8. No fixed version was confirmed, so ask the project and your supplier.

Safeguard Security Team
4 min read

CVE-2021-42141 is a critical severity flaw in Contiki-NG tinyDTLS, scored 9.8 by NVD. One incorrect handshake can complete with different epoch numbers across its messages, which may cause denial of service. It affects code through master commit 53a0d97, and I could not confirm a fixed version.

What's affected

The record says that in Contiki-NG tinyDTLS through 2018-08-30, one incorrect handshake could complete with different epoch numbers in the Client_Hello, Client_key_exchange and Change_cipher_spec packets, which may cause denial of service. The project's issue #27, opened in October 2021, makes the same report against master commit 53a0d97 and includes packet captures from the reporter.

The record's affected range is Contiki-NG tinyDTLS through master branch commit 53a0d97. The vector is CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. I found no fixed version in the pages I could load, so the advisory and the project's issue tracker should be checked for the current state. A maintainer comment on the project's issue tracker points to the Eclipse tinyDTLS project, which suggests the code is also tracked upstream there.

The record was published to NVD in January 2024, although the underlying reports on the project's tracker date from October 2021. The NVD severity is the one used here, and the disclosure text I could load does not give a separate vendor rating.

Weakness class: CWE-755.

How to check if you're exposed

tinyDTLS is usually compiled into firmware, so there is no package manager to ask. The record's affected range is the master branch through commit 53a0d97, so the check is which commit your copy of the library is at.

If the library is a git submodule or a vendored clone with history, this prints a message when your copy is at or before that commit:

git -C path/to/tinydtls merge-base --is-ancestor HEAD 53a0d97 && echo "at or before 53a0d97"

To find where the library lives in a larger tree, run git submodule status | grep -i dtls and find . -maxdepth 6 -iname '*tinydtls*'. If you only have a release archive without history, compare the files against the project at that commit, or ask whoever supplied the SDK which commit it was cut from.

What to do now

  1. Find every product or firmware image that includes tinyDTLS, including the ones built by suppliers.
  2. Record which commit each one was built from, using the check above.
  3. Ask your supplier or the project whether a fixed commit exists for this CVE, and move to it when it does.
  4. Where DTLS is exposed on a network you do not control, add rate limiting and monitoring in front of the device until the fix is in place.
  5. Subscribe to the project's issue tracker so later fixes are noticed.

Why it matters

DTLS is TLS adapted for datagrams, and it adds an epoch number that counts key changes so that a receiver can tell which keys apply to a packet. A handshake in which the epoch moves in an inconsistent way is a handshake the state machine should have rejected. The record files it under CWE-755, improper check or handling of exceptional conditions.

The 9.8 score comes from the vector, not from a proven code execution. NVD rates network reachable, no privileges, no interaction and high impact on all three areas. The only effect the record itself states is denial of service, so read the number as an upper bound.

For constrained devices that rely on DTLS for sensor or control traffic, a handshake that completes when it should not is a protocol state bug first and a crash bug second. The sensible response is to track the library and to keep these services off networks you do not control.

This CVE is not listed in the CISA Known Exploited Vulnerabilities catalog, and none of the pages I read state that it is exploited in the wild. That is a statement about what is known, not a reason to delay the fix.

Quick check

Is this exploited in the wild?

It is not on the CISA Known Exploited Vulnerabilities list, and the pages I read do not claim exploitation.

Why is a denial of service critical?

The score comes from the NVD vector, which assumes high impact on confidentiality, integrity and availability. The record itself only states denial of service.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

We email you a link to confirm, and only then add you to the list. Unsubscribe in one click. Privacy

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.