Heap-use-after-free vulnerability in inflate in grpc
Summary
OSV-2022-460: Heap-use-after-free in inflate. Affects grpc across 2 version ranges.
>= 93cdc8b77e7b3fe4a3afec1c9c7e29b3f02ec3cf, < df3ce2091354762571bff832558110a40af69e2f
>= aacf0e252bf3eda7b8883b3e2fcf39752c459e5f
Fixed in df3ce2091354762571bff832558110a40af69e2f. 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
grpc is an open-source framework that enables remote procedure calls (RPCs) between different systems. It provides a high-performance, language-agnostic way to build distributed applications. The vulnerability affects the inflate function in the zlib library used by grpc. The inflate function is responsible for decompressing data, and the vulnerability arises from a heap-use-after-free issue. This vulnerability can be exploited by an attacker to read sensitive information from the heap memory, potentially leading to remote code execution or information disclosure.
Vulnerability Detail
The heap-use-after-free vulnerability in inflate occurs when the function tries to access memory that has already been freed. This can happen due to a programming error or incorrect handling of memory management. An attacker can craft a malicious input that triggers the vulnerability, causing the application to read data from freed memory. This can lead to various consequences, such as leaking sensitive information or executing arbitrary code. The vulnerability was discovered through the OSS-Fuzz project, and more details can be found in the provided OSS-Fuzz report.
How To Fix
Minimum fixed version
df3ce2091354762571bff832558110a40af69e2f
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If updating the grpc package is not immediately feasible, a possible workaround is to disable or limit the usage of the affected functionality. In this case, it would involve avoiding or minimizing the usage of the zlib compression and decompression features provided by grpc. By not using these features, the vulnerability can be mitigated. However, this workaround may not be suitable for all use cases, and it is still recommended to update to a fixed version of the package as soon as possible.
Conclusion
The heap-use-after-free vulnerability in inflate in grpc can have severe consequences, including remote code execution and information disclosure. It is crucial to update the grpc package to a version that includes the fix or apply the recommended workaround. By taking appropriate actions, you can protect your application from potential attacks. For further support on vulnerability remediation, you can reach out to DevNack.com.
See every vulnerability recorded for grpc →
FAQ
grpc is an open-source framework that enables remote procedure calls (RPCs) between different systems. It provides a high-performance, language-agnostic way to build distributed applications.
A heap-use-after-free vulnerability occurs when a program tries to access memory that has already been freed. This can lead to various consequences, such as leaking sensitive information or executing arbitrary code.
This vulnerability was discovered through the OSS-Fuzz project, which is a continuous fuzzing service for open-source software. The project aims to uncover vulnerabilities by generating and executing a large number of inputs to trigger potential issues.
The potential consequences of this vulnerability include remote code execution and information disclosure. An attacker could exploit the vulnerability to read sensitive information from the heap memory or execute arbitrary code.
You can use Vulert's playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Vulert uses a manifest file like package-lock.json to monitor and alert in real-time for open-source vulnerabilities in the software.
References
Related vulnerabilities
Recent vulnerabilities recorded for grpc.