AES/GCM Nonce Reuse Vulnerability in tech.pegasys.discovery:discovery

Summary

06/04/2021
Yes i
Low
Not published

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 ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback