Vulnerability in nanopb (CVE-2021-21401)
Summary
Vulnerability in nanopb (CVE-2021-21401). Data can be tampered with by attackers. Exploitable via oneof. Mitigation: upgrade to 0.4.5 or later.
Original description
The description as published by the source.
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.
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2021-21401 has been found in nanopb.
Attackers can target a specific entry point like oneof over the network to misuse the product.
Data can be tampered with by attackers.
What to do: upgrade nanopb to 0.4.5 or later.
If unsure, ask your IT team or search "nanopb CVE-2021-21401" on the vendor's site.
CVE-2021-21401 (nanopb) — CWE-763
Attack vector: remote (network-reachable) / no user interaction
Attack surface: oneof
Patched: 0.4.5 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-763) exists in nanopb. Attackers reach the vulnerable code path via oneof.
Check the vendor advisory for the affected versions of nanopb. Attack surface: oneof.
Severity: ?. Data can be tampered with by attackers.
Update to 0.4.5.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'nanopb' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'nanopb' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
nanopbを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade nanopb to 0.4.5ステージング環境で 0.4.5 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
Fix status by distribution
Fixed packages published by each distribution for this CVE
- Debian DEBIAN-CVE-2021-21401 nanopb Fixed in: 0.4.4-2
References
- advisory nvd.nist.gov
- advisory github.com
- package github.com
- patch github.com
- patch github.com
- report github.com
- web github.com
- web github.com