CVE-2019-11840: Golang.org/x/crypto Golang.org/x/crypto/salsa20/salsa Uses Insufficiently Random Values Vulnerability
MODERATECVE-2019-11840 is a MODERATE (CVSS 5.9) golang.org/x/crypto/salsa20/salsa uses insufficiently random values vulnerability (CWE-330: Use of Insufficiently Random Values) affecting Golang.org/x/crypto libraries in the Go ecosystem. The issue involves golang.org/x/crypto/salsa20/salsa uses insufficiently random values. Remediation is available by upgrading affected packages to version 0.0.0-20190320223903-b7391e95e576.
CVE-2019-11840 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2019-11840
To remediate this vulnerability, upgrade all affected Golang.org/x/crypto dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade golang.org/x/crypto to 0.0.0-20190320223903-b7391e95e576
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for golang.org/x/crypto
How to Check if You Are Affected
To determine whether your application is affected by CVE-2019-11840, inspect your project dependencies for Golang.org/x/crypto:
inspect dependencies for golang.org/x/crypto
Analyze the terminal output to locate any version of Golang.org/x/crypto in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20190320223903-b7391e95e576), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-330: Use of Insufficiently Random Values, where the product uses insufficiently random numbers or values in a security context that depends on unpredictable numbers. In Golang.org/x/crypto, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2019-11840 Affected Golang.org/x/crypto Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
golang.org/x/crypto
|
Go |
< 0.0.0-20190320223903-b7391e95e576
|
0.0.0-20190320223903-b7391e95e576
|
References
Frequently Asked Questions
What is CVE-2019-11840?
Which Golang.org/x/crypto versions are affected?
What version fixes CVE-2019-11840?
Is golang.org/x/crypto affected?
What is the CVSS score of CVE-2019-11840?
What CWE is associated with CVE-2019-11840?
How can I check Go dependencies for CVE-2019-11840?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r5c5-pr8j-pfp7",
"modified" : "2023-09-29T15:47:38Z",
"published" : "2022-05-24T16:45:25Z",
"aliases" : [ "CVE-2019-11840" ],
"summary" : "golang.org/x/crypto/salsa20/salsa uses insufficiently random values",
"details" : "An issue was discovered in supplementary Go cryptography libraries, aka golang-googlecode-go-crypto, before 2019-03-20. A flaw was found in the amd64 implementation of golang.org/x/crypto/salsa20 and golang.org/x/crypto/salsa20/salsa. 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.\n\n### Specific Go Packages Affected\ngolang.org/x/crypto/salsa20/salsa",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "golang.org/x/crypto"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.0.0-20190320223903-b7391e95e576"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-11840"
}, {
"type" : "WEB",
"url" : "https://github.com/golang/go/issues/30965"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=1691529"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/golang/go"
}, {
"type" : "WEB",
"url" : "https://go.dev/cl/168406"
}, {
"type" : "WEB",
"url" : "https://go.dev/issue/30965"
}, {
"type" : "WEB",
"url" : "https://go.googlesource.com/crypto/+/b7391e95e576cacdcdd422573063bc057239113d"
}, {
"type" : "WEB",
"url" : "https://groups.google.com/forum/#!msg/golang-announce/tjyNcJxb2vQ/n0NRBziSCAAJ"
}, {
"type" : "WEB",
"url" : "https://groups.google.com/g/golang-announce/c/tjyNcJxb2vQ/m/n0NRBziSCAAJ"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2019/06/msg00029.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2020/10/msg00014.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2020/11/msg00016.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2020/11/msg00030.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2021/01/msg00015.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/06/msg00017.html"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2022-0209"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-330" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-02-08T00:33:46Z",
"nvd_published_at" : "2019-05-09T16:29:00Z"
}
}