Safeguard
Vulnerability Analysis•

CVE-2021-42143: Critical Infinite Loop in tinyDTLS

CVE-2021-42143 is a critical infinite loop in Contiki-NG tinyDTLS ClientHello handling, scored 9.1. No fixed version was confirmed, so check your supplier.

Safeguard Security Team
4 min read

CVE-2021-42143 is a critical severity infinite loop in Contiki-NG tinyDTLS, scored 9.1 by NVD. A malformed ClientHello with an odd length of cipher suites can use up all resources and trigger a buffer over-read. It affects code through master commit 53a0d97, and I could not confirm a fix.

What's affected

The record describes an infinite loop in the handling of a ClientHello handshake message. A remote attacker sending a malformed ClientHello with an odd length of cipher suites causes the loop, which consumes all resources, and the record adds that a buffer over-read in the same path could disclose sensitive information. It affects Contiki-NG tinyDTLS through master commit 53a0d97.

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:N/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-835.

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.
  6. If the DTLS port should only talk to known peers, restrict it by address at the network edge.

Why it matters

Cipher suites in a ClientHello are two byte values, so their total length should always be even. Code that walks the list two bytes at a time and does not check that the length is even can step past the end or never reach its stop condition. That is the shape of bug the record describes, and the record files it as CWE-835, loop with unreachable exit condition.

The ClientHello is the first message a server processes, before any authentication. That is why the vector shows no privileges and no user interaction. Anyone who can send a datagram to the port can reach this code.

On a small device with one core, an infinite loop is a complete denial of service. A watchdog that resets the device helps, but it also hands an attacker a repeatable reboot. Network filtering for the DTLS port, to known peers only, is the stronger 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.

Try it yourself

Click through it at your own pace, or open it full screen.

Quick check

Can this leak data as well as hang the device?

The record says the same code path has a buffer over-read that could disclose sensitive information, in addition to the infinite loop.

Does the attacker need to authenticate?

No. The malformed message is the first one in the handshake, so the NVD vector shows no privileges required.

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.