Security
Headlines
HeadlinesLatestCVEs

Headline

GHSA-735f-pc8j-v9w8: protobuf-java has potential Denial of Service issue

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)
ghsa
#google#dos#git#java#ruby#maven#kotlin
  1. GitHub Advisory Database
  2. GitHub Reviewed
  3. CVE-2024-7254

protobuf-java has potential Denial of Service issue

High severity GitHub Reviewed Published Sep 18, 2024 in protocolbuffers/protobuf • Updated Sep 19, 2024

Package

maven com.google.protobuf:protobuf-java (Maven)

Affected versions

< 3.25.5

>= 4.0.0.rc.1, < 4.27.5

>= 4.28.0.rc.1, < 4.28.2

Patched versions

3.25.5

4.27.5

4.28.2

maven com.google.protobuf:protobuf-javalite (Maven)

< 3.25.5

>= 4.0.0.rc.1, < 4.27.5

>= 4.28.0.rc.1, < 4.28.2

maven com.google.protobuf:protobuf-kotlin (Maven)

< 3.25.5

>= 4.0.0.rc.1, < 4.27.5

>= 4.28.0.rc.1, < 4.28.2

maven com.google.protobuf:protobuf-kotlin-lite (Maven)

< 3.25.5

>= 4.0.0.rc.1, < 4.27.5

>= 4.28.0.rc.1, < 4.28.2

< 3.25.5

>= 4.0.0.rc.1, < 4.27.5

>= 4.28.0.rc.1, < 4.28.2

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)

References

  • GHSA-735f-pc8j-v9w8
  • https://nvd.nist.gov/vuln/detail/CVE-2024-7254
  • protocolbuffers/protobuf@4728531
  • protocolbuffers/protobuf@850fcce
  • protocolbuffers/protobuf@9a5f5fe
  • protocolbuffers/protobuf@ac9fb5b
  • protocolbuffers/protobuf@cc8b348
  • protocolbuffers/protobuf@d6c82fc

Published to the GitHub Advisory Database

Sep 19, 2024

Last updated

Sep 19, 2024

Related news

Red Hat Security Advisory 2024-9571-03

Red Hat Security Advisory 2024-9571-03 - Streams for Apache Kafka 2.8.0 is now available from the Red Hat Customer Portal. Issues addressed include denial of service and man-in-the-middle vulnerabilities.

Red Hat Security Advisory 2024-7972-03

Red Hat Security Advisory 2024-7972-03 - An update for Red Hat Build of Apache Camel 4.4 for Quarkus 3.8 update is now available. The purpose of this text-only errata is to inform you about the enhancements that improve your developer experience and ensure the security and stability of your products. Red Hat Product Security has rated this update as having a security impact of Critical. Issues addressed include a code execution vulnerability.