Memory leak in nanopb
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 1 without a fix
Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-119 and the CVSS impact.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| nanopb | nanopb | before 0.3.9.7; 0.4.0 to before 0.4.4 | 0.3.9.7, 0.4.4 | Patch available | CNA |
| — | nanopb (PyPI) | 0.3.2 to before 0.3.9.7 | 0.3.9.7 | Patch available | GHSA-85rr-4rh9-hhwh |
| — | nanopb (PyPI) | 0.4.0 to before 0.4.4 | 0.4.4 | Patch available | GHSA-85rr-4rh9-hhwh |
- nanopb Vendornanopb Affected before 0.3.9.7; 0.4.0 to before 0.4.4 Fixed in 0.3.9.7, 0.4.4 Patch available CNA
- nanopb (PyPI) Vendor— Affected 0.3.2 to before 0.3.9.7 Fixed in 0.3.9.7 Patch available GHSA-85rr-4rh9-hhwh
- nanopb (PyPI) Vendor— Affected 0.4.0 to before 0.4.4 Fixed in 0.4.4 Patch available GHSA-85rr-4rh9-hhwh
Remediation
- Fix · CNA nanopb (nanopb) Fixed in 0.3.9.7, 0.4.4
- Fix · GHSA-85rr-4rh9-hhwh nanopb (PyPI) Fixed in 0.3.9.7 Advisory →
- Fix · GHSA-85rr-4rh9-hhwh nanopb (PyPI) Fixed in 0.4.4 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| OpenShift Service Mesh 1 | Affected | No fix planned: Will not fix |
Timeline
- 2026-10-02 Threatist record created from CVE-2020-26243
- 2026-10-03 Alias added: GHSA-85rr-4rh9-hhwh
References
More Nanopb vulnerabilities
- TI-2014-08406 Nanopb before 0.3.1 allows size_t overflows in pb_dec_bytes and pb_dec_string. CVSS 3.1CRITICAL 9.8
- TI-2020-04291 Out-of-memory condition in Nanopb is potentially exploitable CVSS 3.1CRITICAL 9.8
- TI-2021-04499 Invalid free() call in Nanopb CVSS 3.1HIGH 7.1
Sources
- CVE-2020-26243 · CVE Program
- CVE-2020-26243 · NVD
- FIRST EPSS
- GHSA-85rr-4rh9-hhwh · GitHub Advisory Database · CC BY 4.0
- CVE-2020-26243 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences