Skip to content

Discovery uses the same AES/GCM Nonce throughout the session

Low severity GitHub Reviewed Published Mar 26, 2021 in Consensys/discovery • Updated Dec 2, 2025

Package

maven tech.pegasys.discovery:discovery (Maven)

Affected versions

< 0.4.5

Patched versions

0.4.5

Description

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:

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.

References

@ajsutton ajsutton published to Consensys/discovery Mar 26, 2021
Reviewed Mar 30, 2021
Published to the GitHub Advisory Database Apr 6, 2021
Last updated Dec 2, 2025

Severity

Low

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(61st percentile)

Weaknesses

Reusing a Nonce, Key Pair in Encryption

Nonces should be used for the present occasion and only once. Learn more on MITRE.

Use of Insufficiently Random Values

The product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers. Learn more on MITRE.

CVE ID

CVE-2024-23688

GHSA ID

GHSA-w3hj-wr2q-x83g

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.