Vulnerabilities in pkg:maven/tech.pegasys.discovery/discovery

PACKAGE
Advisory Identifier: GHSA-w3hj-wr2q-x83g
Advisory Summary

CVE-2024-23688 is a LOW discovery uses the same aes/gcm vulnerability (CWE-330: Use of Insufficiently Random Values) affecting Discovery libraries in the Maven ecosystem. The issue involves discovery uses the same aes/gcm nonce throughout the session. Remediation is available by upgrading affected packages to version 0.4.5.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/tech.pegasys.discovery/discovery

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/tech.pegasys.discovery/discovery. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-w3hj-wr2q-x83g CVE-2024-23688 LOW Discovery uses the same AES/GCM Nonce throughout the session
GHSA-wp4m-7hpj-8qp8 - MODERATE Duplicate Advisory: Discovery uses the same AES/GCM Nonce throughout the session

CVE-2024-23688 at a Glance

CVE Identifier CVE-2024-23688
GHSA Identifier GHSA-w3hj-wr2q-x83g
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-330: Use of Insufficiently Random Values
Affected Product Discovery
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2024-23688

To remediate this vulnerability, upgrade all affected Discovery dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

tech.pegasys.discovery:discovery fixed: 0.4.5
<dependency>
    <groupId>tech.pegasys.discovery</groupId>
    <artifactId>discovery</artifactId>
    <version>0.4.5</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=tech.pegasys.discovery

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-23688, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=tech.pegasys.discovery

Analyze the terminal output to locate any version of Discovery in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.5), your application is affected.

Note: The mvn dependency:tree -Dincludes=tech.pegasys.discovery command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-330: Use of Insufficiently Random Values, where the product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers. In Discovery, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

Discovery uses the same AES/GCM Nonce throughout the session though it should be generated on per message basis which can lead to the leaking of the session key. As the actual ENR record is signed with a different key it is not possible for an attacker to alter the ENR record. Note that the node private key is not compromised, only the session key generated to communicate with an individual peer. From [discovery spec](https://github.com/ethereum/devp2p/blob/f97b8a5b8e9589d3355ebbd9d4a58d5d1644bdf7/discv5/discv5-theory.md#session-cache): > The number of messages which can be encrypted with a certain session key is limited because encryption of each message requires a unique nonce for AES-GCM. In addition to the keys, the session cache must also keep track of the count of outgoing messages to ensure the uniqueness of nonce values. Since the wire protocol uses 96 bit AES-GCM nonces, it is strongly recommended to generate them by encoding the current outgoing message count into the first 32 bits of the nonce and filling the remaining 64 bits with random data generated by a cryptographically secure random number generator.

CVE-2024-23688 Affected Discovery Versions

1 component(s)
Fixed Versions:
0.4.5
Product / Package Ecosystem Affected Versions Fixed Version
tech.pegasys.discovery:discovery
Maven
< 0.4.5
0.4.5

References

Frequently Asked Questions

What is CVE-2024-23688?
CVE-2024-23688 is a security vulnerability in Discovery involving Discovery uses the same AES/GCM Nonce throughout the session under CWE-330: Use of Insufficiently Random Values.
Which Discovery versions are affected?
Affected versions include releases prior to 0.4.5 across affected packages: tech.pegasys.discovery:discovery.
What version fixes CVE-2024-23688?
Upgrading to 0.4.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is discovery affected?
Yes, tech.pegasys.discovery:discovery is affected in releases prior to 0.4.5. Upgrade your dependency to 0.4.5 or later.
What CWE is associated with CVE-2024-23688?
CVE-2024-23688 is classified under CWE-330: Use of Insufficiently Random Values (The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.).
How can I check Maven dependencies for CVE-2024-23688?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=tech.pegasys.discovery'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w3hj-wr2q-x83g",
  "modified" : "2025-12-02T01:28:16Z",
  "published" : "2021-04-06T17:22:17Z",
  "aliases" : [ "CVE-2024-23688" ],
  "summary" : "Discovery uses the same AES/GCM Nonce throughout the session",
  "details" : "Discovery uses the same AES/GCM Nonce throughout the session though it should be generated on per message basis which can lead to the leaking of the session key.  As the actual ENR record is signed with a different key it is not possible for an attacker to alter the ENR record. Note that the node private key is not compromised, only the session key generated to communicate with an individual peer.\n\nFrom [discovery spec](https://github.com/ethereum/devp2p/blob/f97b8a5b8e9589d3355ebbd9d4a58d5d1644bdf7/discv5/discv5-theory.md#session-cache):\n> The number of messages which can be encrypted with a certain session key is limited because encryption of each message requires a unique nonce for AES-GCM. In addition to the keys, the session cache must also keep track of the count of outgoing messages to ensure the uniqueness of nonce values. Since the wire protocol uses 96 bit AES-GCM nonces, it is strongly recommended to generate them by encoding the current outgoing message count into the first 32 bits of the nonce and filling the remaining 64 bits with random data generated by a cryptographically secure random number generator.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "tech.pegasys.discovery:discovery"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.4.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ConsenSys/discovery/security/advisories/GHSA-w3hj-wr2q-x83g"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-23688"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ConsenSys/discovery"
  }, {
    "type" : "WEB",
    "url" : "https://vulncheck.com/advisories/vc-advisory-GHSA-w3hj-wr2q-x83g"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-323", "CWE-330" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-03-30T17:04:34Z",
    "nvd_published_at" : null
  }
}