Heap-use-after-free vulnerability in inflate in grpc

grpc Updated 02 Oct 2025

Summary

06/06/2022
HIGH
Yes i
High
Not published

OSV-2022-460: Heap-use-after-free in inflate. Affects grpc across 2 version ranges.

>= 93cdc8b77e7b3fe4a3afec1c9c7e29b3f02ec3cf, < df3ce2091354762571bff832558110a40af69e2f >= aacf0e252bf3eda7b8883b3e2fcf39752c459e5f

Fixed in df3ce2091354762571bff832558110a40af69e2f. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for grpc.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback