Loading...
Skip to main content

CVE-2024-7254 — Vulnerability in com.google.protobuf:protobuf-java...

HIGH

protobuf-java has potential Denial of Service issue

Published September 19, 2024Updated September 10, 2026Source: osv

Summary

### Summary When parsing unknown fields in the Protobuf Java Lite and Full library, a maliciously crafted message can cause a StackOverflow error and lead to a program crash. Reporter: Alexis Challande, Trail of Bits Ecosystem Security Team <ecosystem@trailofbits.com> Affected versions: This issue affects all versions of both the Java full and lite Protobuf runtimes, as well as Protobuf for Kotlin and JRuby, which themselves use the Java Protobuf runtime. ### Severity [CVE-2024-7254](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-7254) **High** CVSS4.0 Score 8.7 (NOTE: there may be a delay in publication) This is a potential Denial of Service. Parsing nested groups as unknown fields with DiscardUnknownFieldsParser or Java Protobuf Lite parser, or against Protobuf map fields, creates unbounded recursions that can be abused by an attacker. ### Proof of Concept For reproduction details, please refer to the unit tests (Protobuf Java [LiteTest](https://github.com/protocolbuffers/protobuf/blob/a037f28ff81ee45ebe008c64ab632bf5372242ce/java/lite/src/test/java/com/google/protobuf/LiteTest.java) and [CodedInputStreamTest](https://github.com/protocolbuffers/protobuf/blob/a037f28ff81ee45ebe008c64ab632bf5372242ce/java/core/src/test/java/com/google/protobuf/CodedInputStreamTest.java)) that identify the specific inputs that exercise this parsing weakness. ### Remediation and Mitigation We have been working diligently to address this issue and have released a mitigation that is available now. Please update to the latest available versions of the following packages: * protobuf-java (3.25.5, 4.27.5, 4.28.2) * protobuf-javalite (3.25.5, 4.27.5, 4.28.2) * protobuf-kotlin (3.25.5, 4.27.5, 4.28.2) * protobuf-kotlin-lite (3.25.5, 4.27.5, 4.28.2) * com-protobuf [JRuby gem only] (3.25.5, 4.27.5, 4.28.2)

Advisory Timeline

  • First published September 19, 2024 (753 days ago).
  • Last revised September 10, 2026 — 720 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Maven
Update com.google.protobuf:protobuf-java to 4.28.2 or later
<!-- Update pom.xml dependency version to 4.28.2 for com.google.protobuf:protobuf-java -->
Maven
Update com.google.protobuf:protobuf-javalite to 3.25.5 or later
<!-- Update pom.xml dependency version to 3.25.5 for com.google.protobuf:protobuf-javalite -->
Bundler
Update google-protobuf to 4.28.2 or later
gem install google-protobuf -v 4.28.2
Maven
Update com.google.protobuf:protobuf-java to 4.27.5 or later
<!-- Update pom.xml dependency version to 4.27.5 for com.google.protobuf:protobuf-java -->
Maven
Update com.google.protobuf:protobuf-kotlin-lite to 4.27.5 or later
<!-- Update pom.xml dependency version to 4.27.5 for com.google.protobuf:protobuf-kotlin-lite -->
Maven
Update com.google.protobuf:protobuf-kotlin to 4.28.2 or later
<!-- Update pom.xml dependency version to 4.28.2 for com.google.protobuf:protobuf-kotlin -->
Maven
Update com.google.protobuf:protobuf-kotlin to 3.25.5 or later
<!-- Update pom.xml dependency version to 3.25.5 for com.google.protobuf:protobuf-kotlin -->
Maven
Update com.google.protobuf:protobuf-kotlin-lite to 3.25.5 or later
<!-- Update pom.xml dependency version to 3.25.5 for com.google.protobuf:protobuf-kotlin-lite -->
Maven
Update com.google.protobuf:protobuf-kotlin to 4.27.5 or later
<!-- Update pom.xml dependency version to 4.27.5 for com.google.protobuf:protobuf-kotlin -->
Maven
Update com.google.protobuf:protobuf-kotlin-lite to 4.28.2 or later
<!-- Update pom.xml dependency version to 4.28.2 for com.google.protobuf:protobuf-kotlin-lite -->
Maven
Update com.google.protobuf:protobuf-javalite to 4.27.5 or later
<!-- Update pom.xml dependency version to 4.27.5 for com.google.protobuf:protobuf-javalite -->
Bundler
Update google-protobuf to 3.25.5 or later
gem install google-protobuf -v 3.25.5
Maven
Update com.google.protobuf:protobuf-java to 3.25.5 or later
<!-- Update pom.xml dependency version to 3.25.5 for com.google.protobuf:protobuf-java -->
Bundler
Update google-protobuf to 4.27.5 or later
gem install google-protobuf -v 4.27.5
Maven
Update com.google.protobuf:protobuf-javalite to 4.28.2 or later
<!-- Update pom.xml dependency version to 4.28.2 for com.google.protobuf:protobuf-javalite -->

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (15)

Affects 2 ecosystems: maven (4), rubygems (1).

PackageEcosystemAffectedFixed In
com.google.protobuf:protobuf-java
maven
4.28.0, 4.28.0-RC1, 4.28.0-RC2, 4.28.0-RC3 (+1 more)4.28.2
com.google.protobuf:protobuf-javalite
maven
3.10.0, 3.10.0-rc-1, 3.11.0, 3.11.0-rc-1 (+110 more)3.25.5
google-protobuf
rubygems
4.28.0, 4.28.0.rc.1, 4.28.0.rc.2, 4.28.0.rc.3 (+1 more)4.28.2
com.google.protobuf:protobuf-java
maven
4.0.0-rc-1, 4.0.0-rc-2, 4.26.0, 4.26.0-RC1 (+11 more)4.27.5
com.google.protobuf:protobuf-kotlin-lite
maven
4.26.0, 4.26.0-RC1, 4.26.0-RC2, 4.26.0-RC3 (+9 more)4.27.5
com.google.protobuf:protobuf-kotlin
maven
4.28.0, 4.28.0-RC1, 4.28.0-RC2, 4.28.0-RC3 (+1 more)4.28.2
com.google.protobuf:protobuf-kotlin
maven
3.17.0, 3.17.0-rc-2, 3.17.1, 3.17.2 (+67 more)3.25.5
com.google.protobuf:protobuf-kotlin-lite
maven
3.17.0, 3.17.0-rc-2, 3.17.1, 3.17.2 (+67 more)3.25.5
com.google.protobuf:protobuf-kotlin
maven
4.26.0, 4.26.0-RC1, 4.26.0-RC2, 4.26.0-RC3 (+9 more)4.27.5
com.google.protobuf:protobuf-kotlin-lite
maven
4.28.0, 4.28.0-RC1, 4.28.0-RC2, 4.28.0-RC3 (+1 more)4.28.2
com.google.protobuf:protobuf-javalite
maven
4.0.0-rc-1, 4.0.0-rc-2, 4.26.0, 4.26.0-RC1 (+11 more)4.27.5
google-protobuf
rubygems
3.0.0, 3.0.0.alpha.1.0, 3.0.0.alpha.1.1, 3.0.0.alpha.2.0 (+142 more)3.25.5
com.google.protobuf:protobuf-java
maven
2.0.1, 2.0.3, 2.1.0, 2.2.0 (+143 more)3.25.5
google-protobuf
rubygems
4.26.0, 4.26.0.rc.1, 4.26.0.rc.2, 4.26.0.rc.3 (+9 more)4.27.5
com.google.protobuf:protobuf-javalite
maven
4.28.0, 4.28.0-RC1, 4.28.0-RC2, 4.28.0-RC3 (+1 more)4.28.2

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-20
    Improper Input ValidationMITRE
  • CWE-400
    Uncontrolled Resource ConsumptionMITRE
  • CWE-787
    Out-of-bounds WriteMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Frequently Asked Questions

What is CVE-2024-7254?
protobuf-java has potential Denial of Service issue This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2024-7254?
CVE-2024-7254 affects com.google.protobuf:protobuf-java, com.google.protobuf:protobuf-javalite and google-protobuf (and 2 more). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-7254 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-735f-pc8j-v9w8

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies