AES/GCM Nonce Reuse Vulnerability in tech.pegasys.discovery:discovery
Summary
CVE-2024-23688: Discovery uses the same AES/GCM Nonce throughout the session. Affects tech.pegasys.discovery:discovery versions < 0.4.5. Fixed in 0.4.5. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The tech.pegasys.discovery:discovery package is a Maven package that is used for discovery in Ethereum networks. It facilitates communication between nodes by generating session keys for secure messaging. However, a vulnerability has been discovered in the package where the same AES/GCM Nonce is used throughout a session, instead of generating a new one for each message. This can lead to the leaking of the session key and potential compromise of communication with individual peers. It is important to note that the node private key is not compromised, only the session key.
Vulnerability Detail
The vulnerability arises from the improper use of AES/GCM Nonces in the session cache. According to the discovery specification, each message should be encrypted with a unique nonce to ensure the security of the session key. However, the package fails to generate a new nonce for each message, using the same one throughout the session. This can allow an attacker to potentially obtain the session key and compromise communication with a specific peer. It is recommended to generate unique nonces by encoding the current outgoing message count into the first 32 bits of the nonce and filling the remaining 64 bits with random data from a cryptographically secure random number generator.
How To Fix
Minimum fixed version
0.4.5
This is the first release that contains the fix.
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to update the package to the latest version as soon as possible.
Conclusion
The tech.pegasys.discovery:discovery package is vulnerable to an AES/GCM Nonce reuse issue, which can lead to the leaking of the session key used for communication with individual peers. To mitigate this vulnerability, it is crucial to update the package to version 0.4.5 or later. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for tech.pegasys.discovery:discovery →
FAQ
The vulnerability can potentially lead to the leaking of the session key used for communication with individual peers. This can compromise the confidentiality and integrity of the communication.
No, the ENR record is signed with a different key and cannot be altered by an attacker exploiting this vulnerability. Only the session key used for communication with a specific peer is at risk.
No, the node private key is not compromised. Only the session key, which is generated for communication with individual peers, is potentially leaked due to the vulnerability.
It is strongly recommended to encode the current outgoing message count into the first 32 bits of the nonce and fill the remaining 64 bits with random data from a cryptographically secure random number generator.
The severity of this vulnerability is rated as LOW.
References
Related vulnerabilities
Recent vulnerabilities recorded for tech.pegasys.discovery:discovery.