CVE-2020-26243
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.
| Package | Ecosystem | Fixed in |
|---|---|---|
| nanopb | nanopb_project | 0.4.4, 0.3.9.7 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| nanopb | nanopb | < 0.3.9.7, >= 0.4.0, < 0.4.4 |
| PyPI | nanopb | 0.3.2, 0.4.0 |
| nanopb | nanopb | 0, 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
- x_refsource_CONFIRM
- x_refsource_MISC
- x_refsource_MISC
- x_refsource_MISC
- https://nvd.nist.gov/vuln/detail/CVE-2020-26243 advisory
- https://github.com/advisories/GHSA-85rr-4rh9-hhwh advisory