Every CVE Search/ Get API key

CVE-2020-26243

Memory leak in nanopb

7.5 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

2.66%Up 1.6 points since Apr 14, 2021
90%50%10%1%

What each source reports

CVE List Score used 7.5

Memory leak in nanopb

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.

Record
CVE-2020-26243
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-20, CWE-119
Updated
2026-11-02
EUVDEUVD-2020-1450 7.5

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.

Record
EUVD-2020-1450
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-03
GitHub AdvisoriesGHSA-85rr-4rh9-hhwh 7.5

Memory leak in Nanopb

Impact

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.

Patches

Preliminary patch is available on git and problem will be patched in versions 0.3.9.7 and 0.4.4 once testing has been completed.

Workarounds

Following workarounds are available:

  • 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.
  • 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.
  • Use an arena allocator for nanopb, to make sure all memory can be released afterwards.

References

Bug report: https://github.com/nanopb/nanopb/issues/615

For more information

If you have any questions or comments about this advisory, comment on the bug report linked above.

Record
GHSA-85rr-4rh9-hhwh
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-20, CWE-119
Updated
2026-11-02
NVD 7.5

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.

Record
CVE-2020-26243
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 2.0
4.3 MediumAV:N/AC:M/Au:N/C:N/I:N/A:P
Weakness
CWE-20, CWE-119
Updated
2026-11-02
OSV 7.5

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.

Record
CVE-2020-26243
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2020-26243 7.5

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.

Record
DEBIAN-CVE-2020-26243
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
Show 5 moreShow less
OSVGHSA-85rr-4rh9-hhwh 7.5

Memory leak in Nanopb

Impact

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.

Patches

Preliminary patch is available on git and problem will be patched in versions 0.3.9.7 and 0.4.4 once testing has been completed.

Workarounds

Following workarounds are available:

  • 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.
  • 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.
  • Use an arena allocator for nanopb, to make sure all memory can be released afterwards.

References

Bug report: https://github.com/nanopb/nanopb/issues/615

For more information

If you have any questions or comments about this advisory, comment on the bug report linked above.

Record
GHSA-85rr-4rh9-hhwh
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-119, CWE-20
Updated
2026-11-02
OSVPYSEC-2026-684 7.5

Memory leak in Nanopb

Impact

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.

Patches

Preliminary patch is available on git and problem will be patched in versions 0.3.9.7 and 0.4.4 once testing has been completed.

Workarounds

Following workarounds are available:

  • 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.
  • 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.
  • Use an arena allocator for nanopb, to make sure all memory can be released afterwards.

References

Bug report: https://github.com/nanopb/nanopb/issues/615

For more information

If you have any questions or comments about this advisory, comment on the bug report linked above.

Record
PYSEC-2026-684
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2020-26243 7.5

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.

Record
UBUNTU-CVE-2020-26243
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVopenSUSE-SU-2024:11074-1 No score

libprotobuf-nanopb0-0.4.5-1.3 on GA media

These are all security issues fixed in the libprotobuf-nanopb0-0.4.5-1.3 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:11074-1
Updated
2026-11-02
OSVUSN-6121-1 No score

nanopb vulnerabilities

It was discovered that Nanopb incorrectly handled certain decode messages. An attacker could possibly use this cause a denial of service or expose sensitive information. (CVE-2020-26243)

It was discovered that Nanopb incorrectly handled certain decode messages. An attacker could possibly use this issue to cause a denial of service or execute arbitrary code. (CVE-2021-21401)

Record
USN-6121-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
nanopb
PyPI
0.3.2 to 0.3.9.6
0.3.9.7
nanopb
PyPI
0.4.0 up to 0.4.4
0.4.4
nanopb
Debian:12
before 0.4.4-1
0.4.4-1
nanopb
Debian:13
before 0.4.4-1
0.4.4-1
nanopb
Debian:14
before 0.4.4-1
0.4.4-1
nanopb
PyPI
0.3.2 up to 0.3.9.7, plus listed versions
0.3.9.4.post30.3.9.50.3.9.6
0.3.9.7
nanopb
PyPI
0.4.0 up to 0.4.4, plus listed versions
0.4.10.4.1.dev10030.4.1.dev10070.4.1.dev10120.4.1.dev1013
Show 45 moreShow less
0.4.1.dev10170.4.1.dev10360.4.1.dev9590.4.1.dev9610.4.1.dev9620.4.1.dev9640.4.1.dev9710.4.1.dev9780.4.1.dev9800.4.1.dev9850.4.1.dev9870.4.1.dev9880.4.1.dev9960.4.1.dev9970.4.20.4.2.dev10410.4.2.dev10430.4.2.dev10440.4.2.dev10450.4.2.dev10480.4.2.dev10500.4.2.dev10530.4.2.dev10540.4.2.dev10550.4.2.dev10580.4.2.dev10590.4.2.dev10630.4.2.dev10660.4.2.dev10700.4.2.dev10710.4.2.dev10720.4.2.dev10760.4.2.dev10880.4.2.dev10910.4.30.4.3.dev11280.4.3.dev11310.4.3.dev11320.4.3.dev11330.4.3.dev11370.4.3.dev11500.4.3.dev11640.4.3.dev11720.4.3.dev11750.4.3.dev1177
0.4.4
nanopb
PyPI
0.3.2 up to 0.3.9.7, 0.4.0 up to 0.4.4, plus listed versions
0.3.9.4.post30.3.9.50.3.9.60.4.10.4.1.dev1003
Show 45 moreShow less
0.4.1.dev10070.4.1.dev10120.4.1.dev10130.4.1.dev10170.4.1.dev10360.4.1.dev9590.4.1.dev9610.4.1.dev9620.4.1.dev9640.4.1.dev9710.4.1.dev9780.4.1.dev9800.4.1.dev9850.4.1.dev9870.4.1.dev9880.4.1.dev9960.4.1.dev9970.4.20.4.2.dev10410.4.2.dev10430.4.2.dev10440.4.2.dev10450.4.2.dev10480.4.2.dev10500.4.2.dev10530.4.2.dev10540.4.2.dev10550.4.2.dev10580.4.2.dev10590.4.2.dev10630.4.2.dev10660.4.2.dev10700.4.2.dev10710.4.2.dev10720.4.2.dev10760.4.2.dev10880.4.2.dev10910.4.30.4.3.dev11280.4.3.dev11310.4.3.dev11320.4.3.dev11330.4.3.dev11370.4.3.dev11500.4.3.dev1164
0.3.9.70.4.4
nanopb
Ubuntu:Pro:20.04:LTS
before 0.4.1-1ubuntu0.1~esm1, plus listed versions
0.4.1-1
0.4.1-1ubuntu0.1~esm1
nanopb
Ubuntu:Pro:20.04:LTS
From an advisory covering 2 CVEs
before 0.4.1-1ubuntu0.1~esm1, plus listed versions
0.4.1-1
0.4.1-1ubuntu0.1~esm1
nanopb
openSUSE:Tumbleweed
From an advisory covering 3 CVEs
before 0.4.5-1.3
0.4.5-1.3

History

History
RecordedChangedSources
affected, facts
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2020-26243 is a high vulnerability (CVSS 7.5) in Nanopb, published November 25, 2020. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.66%, the 85th percentile. Fixed in nanopb 0.3.9.7.

References

Show 10 moreShow less
This page doesn't list everything

Left out here: 17 versions. The JSON record has them.

MoveEnter Open