cve.bz

CVE-2021-21401 nanopb project nanopb: Release of Invalid Pointer or Reference

7.1 highExploit referenceEPSS 1.8%Fix available

High (7.1) in nanopb project nanopb. EPSS 1.8% estimated probability of exploitation activity in the next 30 days. Fixed in nanopb 0.3.9.8, 0.4.5.

On this page
Nanopb is a small code-size Protocol Buffers implementation in ansi C. In Nanopb before versions 0.3.9.8 and 0.4.5, decoding a specifically formed message can cause invalid `free()` or `realloc()` calls if the message type contains an `oneof` field, and the `oneof` directly contains both a pointer field and a non-pointer field. If the message data first contains the non-pointer field and then the pointer field, the data of the non-pointer field is incorrectly treated as if it was a pointer value. Such message data rarely occurs in normal messages, but it is a concern when untrusted data is parsed. This has been fixed in versions 0.3.9.8 and 0.4.5. See referenced GitHub Security Advisory for more information including workarounds.

Severity

CVSS 3.1

7.1 high
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L
EPSS
1.8% (unchanged from 1.8% a week ago; 1.8% 30 days ago) estimated probability of exploitation activity in the next 30 days; 79th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-763 Release of Invalid Pointer or Reference
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-21401 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-21401?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-21401?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-21401 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
nanopb_project:nanopbbefore 0.3.9.8
nanopb_project:nanopbfrom 0.4.0 before 0.4.5

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-7mv5-5mxh-qg88PyPInanopb>=0.3.2 <0.3.9.80.3.9.8
GHSA-7mv5-5mxh-qg88PyPInanopb>=0.4.0 <0.4.50.4.5
PYSEC-2021-432PyPInanopb<0.3.9.8
>=0.4.0 <0.4.5
0.3.9.8, 0.4.5

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian12, 13, 14nanopb0.4.4-2DEBIAN-CVE-2021-21401
UbuntuPro:20.04:LTSnanopb0.4.1-1ubuntu0.1~esm1UBUNTU-CVE-2021-21401 USN-6121-1
openSUSETumbleweednanopb0.4.5-1.3openSUSE-SU-2024:11074-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · openSUSE.

References

Check your stackJSON