VDB

CVE-2020-26243

CVE-2020-26243 PUBLISHED CVSS 7.5 HIGH

Memory leak in nanopb

Reported by github_m · Published November 25, 2020

Nanopb is a small code-size Protocol Buffers implementation. In Nanopb before versions 0.4.4 and 0.3.9.7, decoding specifically formed message can leak memory if dynamic allocation is enabled and an oneof field contains a static submessage that contains a dynamic field, and the message being decoded contains the submessage multiple times. This is rare in normal messages, but it is a concern when untrusted data is parsed. This is fixed in versions 0.3.9.7 and 0.4.4. The following workarounds are available: 1) Set the option `no_unions` for the oneof field. This will generate fields as separate instead of C union, and avoids triggering the problematic code. 2) Set the type of the submessage field inside oneof to `FT_POINTER`. This way the whole submessage will be dynamically allocated and the problematic code is not executed. 3) Use an arena allocator for nanopb, to make sure all memory can be released afterwards.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
nanopbnanopb_project0.4.4, 0.3.9.7

Risk scores

CVSS 3.1
7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected products

VendorProductVersions
nanopbnanopb< 0.3.9.7, >= 0.4.0, < 0.4.4
PyPInanopb0.3.2, 0.4.0
nanopbnanopb0, 0.4.0

Timeline

  • Nov 25, 2020 CVE Published
  • Nov 25, 2020 PoC Published
  • Apr 14, 2021 EPSS Score (30 in total, the first dated here)
  • Mar 6, 2026 Distribution Patch
  • Mar 6, 2026 Security Advisory (2 in total, the first dated here)
  • Jun 17, 2026 CVE Updated
  • Sep 1, 2026 Coalition ESS Score

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2020-26243
vulnetix vdb fixes CVE-2020-26243

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2020-26243/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

References

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›