CVE-2020-5235 Out-of-memory condition in Nanopb is potentially exploitable

Medium 6.5 Published Updated

An out-of-memory condition in Nanopb can lead to crashes or memory corruption when decoding specific repeated fields, potentially allowing code execution.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2020-5235?

CVE-2020-5235 is a medium-severity memory corruption vulnerability in Nanopb, published on 4 Feb 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-125

Which versions are affected by CVE-2020-5235?

It affects 1 product.

Products include Nanopb Project Nanopb.

How do I fix CVE-2020-5235?

Upgrade to a fixed version.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2020-5235 being exploited?

There is no known exploitation of CVE-2020-5235 in the wild and no public exploit code.

Sources

Also known as GHSA-6f6v-26gj-6crp, GHSA-gcx3-7m76-287p.

Is CVE-2020-5235 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free