CVE-2024-53984
Medium · 4.3CVSS
4.3
EPSS
0.4%
Published
Dec 2, 2024
CISA due date
—
Cloudanix analysis
A coding mistake in a small data-handling library can cause programs to slowly use up memory when processing certain incoming messages, eventually making those programs stop working.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Low
- Patch risk
- Low
What it actually does
Missing call to pb_release() in pb_decode_ex() when PB_ENABLE_MALLOC, FT_POINTER fields, custom stream with unknown length, and PB_DECODE_DELIMITED flag are used together, causing memory leak on decode failure.
Why it matters to the business
Repeated exploitation can exhaust memory in long-running services, leading to service degradation or denial of service without data loss or unauthorized access.
How an attack unfolds
An attacker supplies a protobuf message over a network stream using a custom callback with unknown length and the delimited decode flag; a decode failure path skips cleanup, accumulating leaked allocations until the process terminates or becomes unresponsive.
How to fix it
Upgrade nanopb to version 0.4.9.1 or commit cad3c18ef15a663e30e3e43e3a752b66378adec1; rebuild all dependent binaries; verify PB_ENABLE_MALLOC configurations are still required.
How to confirm the fix worked
Confirm installed nanopb version is 0.4.9.1 or later; recompile test cases exercising pb_decode_ex with PB_DECODE_DELIMITED and custom streams to verify pb_release is invoked on failure.
Typical attack path
- Identify service using nanopb with PB_ENABLE_MALLOC and FT_POINTER fields
- Craft protobuf payload that triggers decode failure under PB_DECODE_DELIMITED
- Send payload repeatedly via custom stream interface
- Monitor for increasing memory usage leading to DoS
How to detect it
Review application logs for repeated decode failures involving custom streams; inspect process memory growth patterns; search build logs and dependency manifests for nanopb versions prior to 0.4.9.1.
What your security team should do
- Immediately update nanopb to 0.4.9.1 or the referenced commit across all builds
- Audit code for use of PB_ENABLE_MALLOC combined with custom streams and PB_DECODE_DELIMITED
- Add memory-leak regression tests for decode failure paths
- Monitor process memory metrics for unexpected growth in nanopb-using services
The record
Nanopb is a small code-size Protocol Buffers implementation. When the compile time option PB_ENABLE_MALLOC is enabled, the message contains at least one field with FT_POINTER field type, custom stream callback is used with unknown stream length. and the pb_decode_ex() function is used with flag PB_DECODE_DELIMITED, then the pb_decode_ex() function does not automatically call pb_release(), like is done for other failure cases. This could lead to memory leak and potential denial-of-service. This vulnerability is fixed in 0.4.9.1.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | nanopb | 0 | No fix |
| Debian:12 | nanopb | 0 | No fix |
| Debian:13 | nanopb | 0 | 0.4.9.1-1 |
| SUSE:Package Hub 15 SP6 | nanopb | 0 | 0.4.6-bp156.4.3.1 |
| Ubuntu:20.04:LTS | nanopb | 0 | No fix |
| Ubuntu:22.04:LTS | nanopb | 0 | No fix |
| Ubuntu:24.04:LTS | nanopb | 0 | No fix |
| Ubuntu:24.10 | nanopb | 0 | No fix |
| Ubuntu:25.04 | nanopb | 0 | No fix |
| Ubuntu:25.10 | nanopb | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | nanopb | 0 | No fix |
| openSUSE:Leap 15.6 | nanopb | 0 | 0.4.6-bp156.4.3.1 |
Related vulnerabilities
- CVE-2022-20203 In multiple locations of the nanopb library, there is a possible way to corrupt memory… Also affects nanopb
- CVE-2026-109278 ImageMagick before 6.9.13-57 and 7.x before 7.1.2-32 contains a memory leak in the… CWE-401
- CVE-2026-109270 ImageMagick before 7.1.2-32 contains a memory leak vulnerability in the -process option… CWE-401
- CVE-2026-109262 ImageMagick before 6.9.13-57 and 7.x before 7.1.2-32 contains a memory leak in the SVG… CWE-401
- CVE-2026-109263 ImageMagick before 6.9.13-57 and 7.x before 7.1.2-32 contains a memory leak in the YUV… CWE-401
- CVE-2026-109261 ImageMagick before 6.9.13-57 and 7.x before 7.1.2-32 contains a memory leak in the GIF… CWE-401
- CVE-2026-109260 ImageMagick before 6.9.13-57 and 7.x before 7.1.2-32 contains a memory leak in the PNG… CWE-401
- CVE-2026-104874 Multidict is an implementation of a multidict data structure. CWE-401