Vulnerabilities in pkg:golang/github.com/nats-io/nkeys
PACKAGECVE-2023-46129 is a HIGH (CVSS 7.5) xkeys seal encryption used fixed vulnerability (CWE-321: Use of Hard-coded Cryptographic Key) affecting Github.com/nats io/nkeys libraries in the Go ecosystem. The issue involves xkeys seal encryption used fixed key for all encryption. Remediation is available by upgrading affected packages to version 0.4.6, 2.10.4.
pkg:golang/github.com/nats-io/nkeys
Vulnerability advisories affecting package pkg:golang/github.com/nats-io/nkeys. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-mr45-rx8q-wcm9 | CVE-2023-46129 | HIGH | xkeys seal encryption used fixed key for all encryption |
CVE-2023-46129 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2023-46129
To remediate this vulnerability, upgrade all affected Github.com/nats io/nkeys 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 github.com/nats-io/nkeys to 0.4.6
Upgrade github.com/nats-io/nats-server/v2 to 2.10.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/nats-io/nkeys
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-46129, inspect your project dependencies for Github.com/nats io/nkeys:
inspect dependencies for github.com/nats-io/nkeys
Analyze the terminal output to locate any version of Github.com/nats io/nkeys in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.6), 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-321: Use of Hard-coded Cryptographic Key, where the product uses a hard-coded, unchangeable cryptographic key. In Github.com/nats io/nkeys, 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-2023-46129 Affected Github.com/nats io/nkeys Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/nats-io/nkeys
|
Go |
≥ 0.4.0
< 0.4.6
|
0.4.6
|
|
github.com/nats-io/nats-server/v2
|
Go |
≥ 2.10.0
< 2.10.4
|
2.10.4
|
References
Frequently Asked Questions
What is CVE-2023-46129?
Which Github.com/nats io/nkeys versions are affected?
What version fixes CVE-2023-46129?
Is github.com/nats-io/nkeys affected?
Is github.com/nats-io/nats-server/v2 affected?
What is the CVSS score of CVE-2023-46129?
What CWE is associated with CVE-2023-46129?
How can I check Go dependencies for CVE-2023-46129?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-mr45-rx8q-wcm9",
"modified" : "2023-10-31T21:19:02Z",
"published" : "2023-10-31T21:19:02Z",
"aliases" : [ "CVE-2023-46129" ],
"summary" : "xkeys seal encryption used fixed key for all encryption",
"details" : "## Background\n\nNATS.io is a high performance open source pub-sub distributed communication technology, built for the cloud, on-premise, IoT, and edge computing.\n\nThe cryptographic key handling library, nkeys, recently gained support for encryption, not just for signing/authentication. This is used in nats-server 2.10 (Sep 2023) and newer for authentication callouts.\n\n## Problem Description\n\nThe nkeys library's \"xkeys\" encryption handling logic mistakenly passed an array by value into an internal function, where the function mutated that buffer to populate the encryption key to use. As a result, all encryption was actually to an all-zeros key.\n\nThis affects encryption only, not signing. \nFIXME: FILL IN IMPACT ON NATS-SERVER AUTH CALLOUT SECURITY.\n\n## Affected versions\n\nnkeys Go library:\n * 0.4.0 up to and including 0.4.5\n * Fixed with nats-io/nkeys: 0.4.6\n\nNATS Server:\n * 2.10.0 up to and including 2.10.3\n * Fixed with nats-io/nats-server: 2.10.4\n\n## Solution\n\nUpgrade the nats-server. \nFor any application handling auth callouts in Go, if using the nkeys library, update the dependency, recompile and deploy that in lockstep.\n\n## Credits\n\nProblem reported by Quentin Matillat (GitHub @tinou98).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/nats-io/nkeys"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.4.0"
}, {
"fixed" : "0.4.6"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.4.5"
}
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/nats-io/nats-server/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.10.0"
}, {
"fixed" : "2.10.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.10.3"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/nats-io/nkeys/security/advisories/GHSA-mr45-rx8q-wcm9"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-46129"
}, {
"type" : "WEB",
"url" : "https://github.com/nats-io/nkeys/commit/58fb9d69f42ea73fffad1d14e5914dc666f3daa1"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/nats-io/nkeys"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/R3UETKPUB3V5JS5TLZOF3SMTGT5K5APS"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ULQQONMSCQSH5Z5OWFFQHCGEZ3NL4DRJ"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2023/10/31/1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-321", "CWE-325" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-10-31T21:19:02Z",
"nvd_published_at" : "2023-10-31T00:15:09Z"
}
}