Stack Overflow Vulnerability in Protobuf Package: CVE-2024-7254

protobuf Updated 02 Oct 2025

Summary

19/09/2024
N/A
No i
High
7.5

CVE-2024-7254: Any project that parses untrusted Protocol Buffers data containing an arbitrary number of nested groups / series of SGROUP tags can corrupted by exceeding the stack limit i.e. Affects protobuf across 2 version ranges.

< 9d0ec0f92b5b5fdeeda11f9dcecc1872ff378014 < cc8b3483a5584b3301e3d43d17eb59704857ffaa

No fix is published. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The Protobuf package, widely used for serializing structured data, is integral to many applications that require efficient data interchange. It supports various programming languages and is designed to be extensible and efficient. However, the package is vulnerable to a critical issue that arises when parsing untrusted Protocol Buffers data, particularly when it contains nested groups or SGROUP tags.

Vulnerability Detail

CVE-2024-7254 is a vulnerability that allows an attacker to exploit the Protobuf package by sending specially crafted Protocol Buffers data. This data can contain an arbitrary number of nested groups or SGROUP tags, leading to a StackOverflow error due to unbounded recursion during parsing. The vulnerability is particularly concerning when using DiscardUnknownFieldsParser or the Java Protobuf Lite parser, as well as when dealing with Protobuf map fields. If exploited, this vulnerability can cause applications to crash, leading to denial of service.

How To Fix

No fixed version is published for this vulnerability.

To fix this vulnerability, update the Protobuf package to a version that includes the fix for CVE-2024-7254. You can do this by running the following command in your terminal:

sudo apt-get update
sudo apt-get install protobuf

Ensure that you are using a version that is patched against this vulnerability, specifically any version after commit cc8b3483a5584b3301e3d43d17eb59704857ffaa.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If you cannot immediately update the Protobuf package, consider implementing input validation to restrict the depth of nested groups in Protocol Buffers data. This can help mitigate the risk of StackOverflow errors until a proper update can be applied.

Conclusion

CVE-2024-7254 represents a significant vulnerability in the Protobuf package that can lead to application crashes due to StackOverflow errors. It is crucial for developers to update their Protobuf installations to mitigate this risk and ensure the stability and security of their applications.

See every vulnerability recorded for protobuf →

Share this vulnerability

FAQ

CVE-2024-7254 is a vulnerability in the Protobuf package that can lead to a StackOverflow error when parsing untrusted Protocol Buffers data with excessive nesting.

Exploitation of this vulnerability can cause your application to crash, resulting in a denial of service and potentially exposing sensitive data.

All versions of the Protobuf package prior to the fix introduced in commit cc8b3483a5584b3301e3d43d17eb59704857ffaa are vulnerable.

You can use Vulert, which allows you to monitor and alert for open-source vulnerabilities in your software by analyzing your manifest file like package-lock.json. You can also check your application using the Vulert playground without any signup.

Implement input validation to limit the depth of nested groups in Protocol Buffers data as a temporary workaround until you can apply the necessary updates.

Related vulnerabilities

Recent vulnerabilities recorded for protobuf.

How To Fix

No fixed version is published for this vulnerability.

To fix this vulnerability, update the Protobuf package to a version that includes the fix for CVE-2024-7254. You can do this by running the following command in your terminal:

sudo apt-get update
sudo apt-get install protobuf

Ensure that you are using a version that is patched against this vulnerability, specifically any version after commit cc8b3483a5584b3301e3d43d17eb59704857ffaa.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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

Follow Vulert in Google

Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.