GO-2022-0209

Source
https://pkg.go.dev/vuln/GO-2022-0209
Import Source
https://vuln.go.dev/ID/GO-2022-0209.json
JSON Data
https://api.osv.dev/v1/vulns/GO-2022-0209
Aliases
Published
2022-07-01T20:15:25Z
Modified
2024-09-11T06:13:47.355310Z
Summary
Insufficiently random values in golang.org/x/crypto/salsa20
Details

XORKeyStream generates incorrect and insecure output for very large inputs.

If more than 256 GiB of keystream is generated, or if the counter otherwise grows greater than 32 bits, the amd64 implementation will first generate incorrect output, and then cycle back to previously generated keystream. Repeated keystream bytes can lead to loss of confidentiality in encryption applications, or to predictability in CSPRNG applications.

The issue might affect uses of golang.org/x/crypto/nacl with extremely large messages.

Architectures other than amd64 and uses that generate less than 256 GiB of keystream for a single salsa20.XORKeyStream invocation are unaffected.

References
Credits
    • Michael McLoughlin

Affected packages

Go / golang.org/x/crypto

Package

Name
golang.org/x/crypto
View open source insights on deps.dev
Purl
pkg:golang/golang.org/x/crypto

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.0.0-20190320223903-b7391e95e576

Ecosystem specific

{
    "imports": [
        {
            "path": "golang.org/x/crypto/salsa20/salsa",
            "goarch": [
                "amd64"
            ],
            "symbols": [
                "XORKeyStream"
            ]
        }
    ]
}