Null Pointer Dereference Vulnerability in Protobuf Package
Summary
DEBIAN-CVE-2021-22570: Nullptr dereference when a null char is present in a proto symbol. Affects protobuf versions < 3.12.4-1+deb11u1. Fixed in 3.12.4-1+deb11u1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Protobuf (Protocol Buffers) package is a language-agnostic serialization library developed by Google, designed to facilitate the efficient exchange of structured data between applications. It is widely used in various software systems for data serialization and communication. However, a vulnerability has been identified that can lead to a null pointer dereference when a null character is present in a proto symbol, potentially causing application crashes or unexpected behavior.
Vulnerability Detail
The vulnerability arises from improper handling of null characters in proto symbols during parsing. When a null character is encountered, the symbol is incorrectly parsed, leading to an unchecked call into the proto file's name. This results in a null pointer dereference, which can crash the application or lead to undefined behavior. The issue has been assigned the identifier DEBIAN-CVE-2021-22570 and affects multiple versions of the Protobuf package across various Debian releases.
How To Fix
Minimum fixed version
3.12.4-1+deb11u1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade protobuf
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, ensure that your application does not process proto symbols that may contain null characters. This can be done by validating input data before parsing or sanitizing the input to remove any null characters.
Conclusion
In summary, the null pointer dereference vulnerability in the Protobuf package poses a significant risk to applications utilizing this library. It is crucial to upgrade to the patched versions to mitigate potential issues. Additionally, using tools like Vulert can help monitor and manage vulnerabilities in your software effectively.
See every vulnerability recorded for protobuf →
FAQ
A null pointer dereference occurs when a program attempts to access or modify memory at a location that has not been allocated, leading to crashes or undefined behavior.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Simply upload your manifest file, such as package-lock.json, to check for vulnerabilities.
The vulnerability affects Protobuf versions prior to 3.12.4-1+deb11u1 for Debian 11 and versions prior to 3.21.9-3 for Debian 12, 13, and 14.
While the primary risk is application crashes or undefined behavior, there is no direct indication of data loss. However, unexpected behavior could lead to unintended consequences.
Detailed information about this vulnerability can be found in the Debian CVE database at the provided source link.
References
Related vulnerabilities
Recent vulnerabilities recorded for protobuf.