CVE-2020-5235
Out-of-memory condition in Nanopb is potentially exploitable
Check your servers for CVE-2020-5235
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2020-5235 affects nanopb, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
There is a potentially exploitable out of memory condition In Nanopb before 0.4.1, 0.3.9.5, and 0.2.9.4. When nanopb is compiled with PB_ENABLE_MALLOC, the message to be decoded contains a repeated string, bytes or message field and realloc() runs out of memory when expanding the array nanopb can end up calling `free()` on a pointer value that comes from uninitialized memory. Depending on platform this can result in a crash or further memory corruption, which may be exploitable in some cases. This problem is fixed in nanopb-0.4.1, nanopb-0.3.9.5, nanopb-0.2.9.4.
Severity (CVSS)
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:L
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- high: an attack depends on conditions outside the control of the attacker, such as a race
- Privileges required
- none: the attacker does not need an account
- User interaction
- none: nobody has to click or open anything
- Scope
- changed: the damage reaches other components, such as the host of a container or other users
- Impact
- confidentiality low, integrity low, availability low: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 1.73%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 78.0% of all scored CVEs. Scores of 30 Nov 2026.
Weakness
- CWE-125 Out-of-bounds Read
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Nanopb |
affected < 0.2.9.4 affected >= 0.3.0, < 0.3.9.5 affected >= 0.4.0, < 0.4.1
|
Is my server affected?
Find the installed version of nanopb and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i nanopb
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2020-5235 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2020-5235RHEL, Rocky, Alma, Fedora
rpm -q nanopb
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2020-5235Alpine
apk list --installed | grep -i nanopbWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2020-5235
trivy image --scanners vuln IMAGE | grep CVE-2020-5235
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
Other references
- https://github.com/nanopb/nanopb/commit/45582f1f97f49e2abfdba1463d1e1027682d9856 github.com
- https://github.com/nanopb/nanopb/commit/7b396821ddd06df8e39143f16e1dc0a4645b89a3 github.com
- https://github.com/nanopb/nanopb/commit/aa9d0d1ca78d6adec3adfeecf3a706c7f9df81f2 github.com
Source: the record CVE-2020-5235 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse