{"answers":{"affected":"5 open source packages ship an affected version, including nanopb. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-21401 in the wild and no public exploit code.","fix":"Upgrade nanopb to a fixed version for your release line: 0.3.9.8 or 0.4.5.","what":"CVE-2021-21401 is a high-severity memory corruption vulnerability in nanopb, published on 23 Mar 2021. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-21401 and fix it if it is affected.\n\nWhat it is: CVE-2021-21401 is a high-severity memory corruption vulnerability in nanopb, published on 23 Mar 2021. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2021-21401 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- nanopb (PyPI): affected all versions; fixed in 0.3.9.8, 0.4.5\n- nanopb (PyPI): affected from 0.3.2; fixed in 0.3.9.8\n- nanopb (PyPI): affected from 0.3.2; fixed in 0.3.9.8\n- nanopb (PyPI): affected from 0.4.0; fixed in 0.4.5\n- nanopb (PyPI): affected from 0.4.0; fixed in 0.4.5\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-21401/ (Markdown: https://insights.sbomify.com/CVE-2021-21401/index.md)","id":"CVE-2021-21401","markdown":"https://insights.sbomify.com/CVE-2021-21401/index.md","name":"CVE-2021-21401","record":{"aliases":["DEBIAN-CVE-2021-21401","GHSA-7mv5-5mxh-qg88","PYSEC-2021-432","UBUNTU-CVE-2021-21401"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Nanopb Protocol Buffers","requires_auth":"low_privilege","summary":"Attackers can trigger invalid free or realloc calls in Nanopb by sending crafted Protocol Buffers messages with specific oneof fields, potentially leading to crashes or code execution.","user_interaction":"not_required","vuln_class":"memory_corruption"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"nanopb","vendor":"nanopb_project"}],"cvss":{"score":7.1,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L","version":"3.1"},"cwes":[{"id":"CWE-763","name":"Release of Invalid Pointer or Reference"}],"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 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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":"2024-11-05","github_poc":1,"max_poc_stars":0,"metasploit":0,"nuclei":0,"refs":[{"date":"2024-11-05T20:05:20Z","kind":"github_poc","ref":"https://github.com/uthrasri/CVE-2021-21401_nanopb-c_AOSP10_R33","stars":0,"title":null}],"tier":"poc_unverified"},"has_fix":true,"headline":"Invalid free() call in Nanopb","id":"CVE-2021-21401","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"memory_corruption","year":"2021"},"n_packages":5,"n_references":4,"next":{"headline":"Unauthenticated Arbitrary File Access in Jellyfin","id":"CVE-2021-21402"},"packages":[{"ecosystem":"PyPI","fixed":["0.3.9.8","0.4.5"],"introduced":["0","0.4.0"],"last_affected":[],"package":"nanopb","purl":"pkg:pypi/nanopb","source":"PYSEC-2021-432"},{"ecosystem":"PyPI","fixed":["0.3.9.8"],"introduced":["0.3.2"],"last_affected":[],"package":"nanopb","purl":null,"source":"GHSA-7mv5-5mxh-qg88"},{"ecosystem":"PyPI","fixed":["0.3.9.8"],"introduced":["0.3.2"],"last_affected":[],"package":"nanopb","purl":"pkg:pypi/nanopb","source":"GHSA-7mv5-5mxh-qg88"},{"ecosystem":"PyPI","fixed":["0.4.5"],"introduced":["0.4.0"],"last_affected":[],"package":"nanopb","purl":null,"source":"GHSA-7mv5-5mxh-qg88"},{"ecosystem":"PyPI","fixed":["0.4.5"],"introduced":["0.4.0"],"last_affected":[],"package":"nanopb","purl":"pkg:pypi/nanopb","source":"GHSA-7mv5-5mxh-qg88"}],"prev":{"headline":"Entering code in App Lock modal sends input to conversation","id":"CVE-2021-21400"},"products":["nanopb"],"published":"2021-03-23","related":[{"cvss_score":9.8,"headline":"Integer overflow in n/a","id":"CVE-2014-125106","kev_date_added":null,"published":"2023-06-17"},{"cvss_score":7.5,"headline":"Memory leak in nanopb","id":"CVE-2020-26243","kev_date_added":null,"published":"2020-11-25"},{"cvss_score":6.5,"headline":"Out-of-memory condition in Nanopb is potentially exploitable","id":"CVE-2020-5235","kev_date_added":null,"published":"2020-02-04"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["nanopb"]},"summary":"Attackers can trigger invalid free or realloc calls in Nanopb by sending crafted Protocol Buffers messages with specific oneof fields, potentially leading to crashes or code execution.","url":"https://insights.sbomify.com/CVE-2021-21401/"}