PyPi: Nanopb

CVE-2020-5235

Safety vulnerability ID: 59287

This vulnerability was reviewed by experts

The information on this page was manually curated by our Cybersecurity Intelligence Team.

Created at Feb 04, 2020 Updated at Dec 02, 2024
Scan your Python projects for vulnerabilities →

Advisory

Nanopb 0.4.1, 0.3.9.5 and 0.2.9.4 include a fix for CVE-2020-5235: 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.
https://github.com/nanopb/nanopb/security/advisories/GHSA-gcx3-7m76-287p

Affected package

nanopb

Latest version: 0.4.9.1

Nanopb is a small code-size Protocol Buffers implementation in ansi C. It is especially suitable for use in microcontrollers, but fits any memory restricted system.

Affected versions

Fixed versions

Vulnerability changelog

Fix invalid free() after failed realloc() (GHSA-gcx3-7m76-287p)
Avoid overflows in allocation for packed fields.
Verify stream size before allocating string / bytes.
Add workaround for avr-libc realloc() bug (475)
Fix bug with field numbers >255 (407)
Fix compilation error on platforms without uint8_t (485)
Fix warnings on Python3.8 (399, 467)
Make fixed_count option work when combined with FT_POINTER.
Add missing define for submsg callbacks, add regression test (472)
Fix ImportError when using generator/protoc with Python 3
Remove accidental debug code in generator
Reduce stack usage (484)
Remove PB_FIELDINFO_WIDTH option (473)
Add nanopb-specific package name option (422)
Add testcase for Any type (163)
Add exclude option also from .proto/.options
Set default include path in the grpc_tools protoc wrapper.
Add workaround for python-protobuf 3.6.1 bug (478)
Detect invalid wire type when decoding fields.
Improved fuzz testing

Resources

Use this package?

Scan your Python project for dependency vulnerabilities in two minutes

Scan your application

Severity Details

CVSS Base Score

CRITICAL 9.8

CVSS v3 Details

CRITICAL 9.8
Attack Vector (AV)
NETWORK
Attack Complexity (AC)
LOW
Privileges Required (PR)
NONE
User Interaction (UI)
NONE
Scope (S)
UNCHANGED
Confidentiality Impact (C)
HIGH
Integrity Impact (I)
HIGH
Availability Availability (A)
HIGH

CVSS v2 Details

HIGH 7.5
Access Vector (AV)
NETWORK
Access Complexity (AC)
LOW
Authentication (Au)
NONE
Confidentiality Impact (C)
PARTIAL
Integrity Impact (I)
PARTIAL
Availability Impact (A)
PARTIAL