{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-21401","id":"CVE-2021-21401","title":"Invalid free() call in Nanopb","description":"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 ","descriptionLong":"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.","published":"2021-03-23T17:45:19.000Z","updated":"2026-10-20T14:02:36.261859927Z","reserved":"2020-12-22T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L","rating":"high","source":"GitHub_M"},"metrics":[{"version":"4.0","score":null,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N","rating":"high","source":"GitHub"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L","rating":"high","source":"GitHub_M"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L","rating":"high","source":"github.com"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L","rating":"high","source":"NVD"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L","rating":"high","source":"OSV"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L","rating":"high","source":"GitHub"},{"version":"2.0","score":5.5,"vector":"AV:N/AC:L/Au:S/C:N/I:P/A:P","rating":"medium","source":"NVD"}],"rating":"high","products":["nanopb"],"affectedProducts":[{"vendor":"nanopb","product":"nanopb","defaultStatus":null,"versions":[{"status":"affected","version":">= 0.3.2, <= 0.3.9.7"},{"status":"affected","version":">= 0.4.0, <= 0.4.4"}],"platforms":[]}],"packages":[{"ecosystem":"PyPI","name":"nanopb","purl":"pkg:pypi/nanopb","ranges":[">=0.3.2 <0.3.9.8",">=0.4.0 <0.4.5","<0.3.9.8"],"fixed":["0.3.9.8","0.4.5"],"advisory":"GHSA-7mv5-5mxh-qg88"}],"cwes":["CWE-763"],"aliases":["GHSA-7mv5-5mxh-qg88","PYSEC-2021-432"],"references":[{"url":"https://github.com/nanopb/nanopb/security/advisories/GHSA-7mv5-5mxh-qg88","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Patch","Third Party Advisory","fix","web","advisory"]},{"url":"https://github.com/nanopb/nanopb/issues/647","tags":["x_refsource_MISC","x_transferred","Exploit","Issue Tracking","Third Party Advisory","report","web"]},{"url":"https://github.com/nanopb/nanopb/commit/e2f0ccf939d9f82931d085acb6df8e9a182a4261","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/nanopb/nanopb/blob/c9124132a604047d0ef97a09c0e99cd9bed2c818/CHANGELOG.txt#L1","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21401","tags":["advisory"]},{"url":"https://github.com/nanopb/nanopb/commit/4a375a560651a86726e5283be85a9231fd0efe9c","tags":["web"]},{"url":"https://github.com/nanopb/nanopb","tags":["package"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/nanopb/PYSEC-2021-432.yaml","tags":["web"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.01811,"epssPercentile":0.79093,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-21401","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21401","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-21401","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-7mv5-5mxh-qg88","ok":true,"note":"GHSA-7mv5-5mxh-qg88"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-21401","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}