protobuf-java has potential Denial of Service issue

Description

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 <[email protected]>

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 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 and CodedInputStreamTest) 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)

Basic information

Type
reviewed
Severity
high
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2024-09-19 16:06:03 UTC
Updated
2025-09-10 20:53:05 UTC
GitHub reviewed
2024-09-19 16:06:03 UTC
NVD published
2024-09-18

EPSS Score

Score Percentile
0.08% 24.69%

CVSS Scores

Base score Version Severity Vector
7.5 3.1
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
8.7 4.0
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network.
Attack complexity (AC:L)
Exploitation conditions are straightforward and stable.
Attack requirements (AT:N)
No additional preconditions are required beyond normal reachability.
Privileges required (PR:N)
No privileges are required.
User interaction (UI:N)
No user interaction is required.
Vulnerable system confidentiality impact (VC:N)
No confidentiality impact on the vulnerable system.
Vulnerable system integrity impact (VI:N)
No integrity impact on the vulnerable system.
Vulnerable system availability impact (VA:H)
High availability impact on the vulnerable system.
Subsequent system confidentiality impact (SC:N)
No confidentiality impact on subsequent systems.
Subsequent system integrity impact (SI:N)
No integrity impact on subsequent systems.
Subsequent system availability impact (SA:N)
No availability impact on subsequent systems.

Identifiers

CWEs

CWE id Name
CWE-20 Improper Input Validation
CWE-400 Uncontrolled Resource Consumption
CWE-787 Out-of-bounds Write

Credits

  • anlakii (analyst)

Affected packages (15)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
maven com.google.protobuf:protobuf-java < 3.25.5 3.25.5
maven com.google.protobuf:protobuf-javalite < 3.25.5 3.25.5
maven com.google.protobuf:protobuf-kotlin < 3.25.5 3.25.5
maven com.google.protobuf:protobuf-kotlin-lite < 3.25.5 3.25.5
rubygems google-protobuf < 3.25.5 3.25.5
rubygems google-protobuf >= 4.0.0.rc.1, < 4.27.5 4.27.5
rubygems google-protobuf >= 4.28.0.rc.1, < 4.28.2 4.28.2
maven com.google.protobuf:protobuf-kotlin-lite >= 4.0.0-RC1, < 4.27.5 4.27.5
maven com.google.protobuf:protobuf-kotlin-lite >= 4.28.0-RC1, < 4.28.2 4.28.2
maven com.google.protobuf:protobuf-kotlin >= 4.0.0-RC1, < 4.27.5 4.27.5
maven com.google.protobuf:protobuf-kotlin >= 4.28.0-RC1, < 4.28.2 4.28.2
maven com.google.protobuf:protobuf-javalite >= 4.0.0-RC1, < 4.27.5 4.27.5
maven com.google.protobuf:protobuf-javalite >= 4.28.0-RC1, < 4.28.2 4.28.2
maven com.google.protobuf:protobuf-java >= 4.0.0-RC1, < 4.27.5 4.27.5
maven com.google.protobuf:protobuf-java >= 4.28.0-RC1, < 4.28.2 4.28.2

References

cvelogic Threat Intelligence