GHSA-w3hj-wr2q-x83g

Suggest an improvement
Source
https://github.com/advisories/GHSA-w3hj-wr2q-x83g
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/04/GHSA-w3hj-wr2q-x83g/GHSA-w3hj-wr2q-x83g.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-w3hj-wr2q-x83g
Aliases
Published
2021-04-06T17:22:17Z
Modified
2024-01-30T20:14:13.191048Z
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.

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.

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-323"
    ],
    "severity": "LOW",
    "github_reviewed": true,
    "github_reviewed_at": "2021-03-30T17:04:34Z"
}
References

Affected packages

Maven / tech.pegasys.discovery:discovery

Package

Name
tech.pegasys.discovery:discovery
View open source insights on deps.dev
Purl
pkg:maven/tech.pegasys.discovery/discovery

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.4.5