Security Advisory

CVE-2019-20791: OpenThread PSKc Stack Overflow

Last updated:
  • CVE-2019-20791

CVE-2019-20791 is a stack-based buffer overflow (CWE-787) in MeshCoP::Commissioner::GeneratePskc in OpenThread before 2019-12-13: a network name longer than the Thread maximum was copied into a fixed salt buffer. NVD scores it 9.8. Any OpenThread source tree from after the December 2019 fix in pull request 4404 carries the length checks.

Vulnerability summary

CVSS base score

9.8

Critical severity

EPSS score (FIRST)

0.9%

Probability of exploitation in the wild in the next 30 days

CISA KEV catalog

No

Not listed

Published

Vulnerability ID: CVE-2019-20791 · Source: NVD

Affected components

ComponentCPEVersion range
OpenThreadcpe:2.3:o:google:openthread:*:*:*:*:*:*:*:*before 2019-12-13 (NVD); fixed by the pull request 4404 commits of 2019-12-12 and 2019-12-13

What does this mean for affected devices?

NVD's description is one line: "OpenThread before 2019-12-13 has a stack-based buffer overflow in MeshCoP::Commissioner::GeneratePskc." NVD's Primary score is 9.8, CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H (CVSS v2 7.5), with CWE-787. MITRE assigned the CVE and gave no score. The CPE configuration covers OpenThread before 2019-12-13, and NVD links OSS-Fuzz issue 19386 and two OpenThread commits. The record was published on 2020-04-28 (NVD, CVE record).

What does the code do?

GeneratePskc() derives the PSKc, the commissioning credential, from a passphrase, the network name and the extended PAN ID. The salt it feeds to PBKDF2 is the string "Thread", then the extended PAN ID, then the network name, built in a fixed stack buffer. The function checked the passphrase length but not the network name length, so a long name ran past the end of the buffer. The first fix, "add network name length check in GeneratePskc()", dated 2019-12-12, adds a check against OT_NETWORK_NAME_MAX_SIZE. The second, "use strnlen instead of strlen", dated 2019-12-13, bounds every length read in the function and in AddJoiner(). Both belong to pull request 4404, merged on 2019-12-16.

How do you find and fix it in a product?

OpenThread is built into device firmware, so the fix is a rebuild. Silicon vendors also ship it inside their own SDKs under vendor version numbers, as Silicon Labs does with its OpenThread SDK. Use a firmware SBOM to find the OpenThread source revision in each image, and treat a tree older than 2019-12-13 as affected. Pass only validated network names to the commissioner API. Our Thread security guide explains PSKc and commissioning, and the memory corruption fix guide covers bounded copies. Later OpenThread flaws are CVE-2023-2626, a border router authentication bypass, and CVE-2025-36939, an MLE stack overflow.

CVE-2019-20791 is not in the CISA KEV catalog as of 2026-11-18 (catalog version 2026.11.17). FIRST EPSS gives it 0.00878, the 59.7th percentile, in the 2026-11-17 dataset (CISA KEV, FIRST EPSS).

How to fix this class of issueThis advisory's weakness class is Memory corruption. Our practical guide covers how to detect, fix, verify and disclose it: How to fix memory corruption in embedded firmware.

Evidence

  • NVD: OpenThread before 2019-12-13 stack-based buffer overflow in MeshCoP::Commissioner::GeneratePskc; [email protected] Primary CVSS 3.1 9.8 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, CVSS v2 7.5; CWE-787; CPE google:openthread before 2019-12-13; references OSS-Fuzz issue 19386 and commits b8c3161 and c3a3a0c; published 2020-04-28. — NVD
  • Commit b8c3161 (2019-12-12) "[commissioner] add network name length check in GeneratePskc() (#4404)": adds strlen(aNetworkName) <= OT_NETWORK_NAME_MAX_SIZE check before building the salt from "Thread", extended PAN ID and network name. — OpenThread on GitHub
  • Commit c3a3a0c (2019-12-13) "[commissioner] use strnlen instead of strlen (#4404)": bounded lengths in GeneratePskc() and AddJoiner(). — OpenThread on GitHub
  • Pull request 4404 "[commissioner] add network name length check in GeneratePskc()", opened 2019-12-12, merged 2019-12-16. — OpenThread on GitHub
  • CVE record (CNA MITRE): no vendor or product data; references OSS-Fuzz issue 19386 and the two OpenThread commits. — CVE.org
  • Not in the CISA KEV catalog, version 2026.11.17 (1,782 entries), checked 2026-11-18. — CISA KEV
  • EPSS 0.00878, percentile 0.59653, dataset 2026-11-17, read 2026-11-18. — FIRST EPSS

Related advisories

Sources

  1. NVD
  2. CVE.org record CVE-2019-20791 (CNA: MITRE)
  3. OpenThread commit: add network name length check in GeneratePskc()
  4. OpenThread commit: use strnlen instead of strlen
  5. OpenThread pull request 4404
  6. CISA KEV
  7. FIRST EPSS

Frequently asked questions

Which OpenThread version fixes CVE-2019-20791?

OpenThread has no numbered release for it; NVD marks source trees before 2019-12-13 as affected. The fix is the pair of commits in pull request 4404, dated 2019-12-12 and 2019-12-13 and merged on 2019-12-16 (per NVD and the OpenThread repository).

What input triggers CVE-2019-20791?

A network name longer than OT_NETWORK_NAME_MAX_SIZE passed to GeneratePskc(), which copies it into a fixed stack buffer used as the PBKDF2 salt. The fix adds that length check and replaces strlen with strnlen (per the OpenThread commits).

How do I check a Thread product for CVE-2019-20791?

Find the OpenThread source revision the firmware was built from, often inside a silicon vendor SDK, and check that it is newer than 2019-12-13 or contains the pull request 4404 commits (per NVD and the OpenThread repository).

Is CVE-2019-20791 exploited in the wild?

It is not in the CISA KEV catalog as of 2026-11-18 (catalog version 2026.11.17). FIRST EPSS gives it 0.00878, the 59.7th percentile, in the 2026-11-17 dataset (per CISA KEV and FIRST EPSS).