# CVE-2023-46129: xkeys Seal encryption used fixed key for all encryption

> The nkeys library used an all-zeros key for encryption, allowing attackers to bypass authentication callout security in NATS server deployments.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 30 Oct 2023
- **Updated:** 27 Feb 2025
- **Also known as:** AZL-31792, AZL-35298, BIT-nats-2023-46129, CLEANSTART-2026-JI58569, CLEANSTART-2026-ST31777, DEBIAN-CVE-2023-46129, GHSA-mr45-rx8q-wcm9, GO-2023-2163, UBUNTU-CVE-2023-46129

## What is CVE-2023-46129?

CVE-2023-46129 is a high-severity vulnerability in nats-io nkeys, published on 30 Oct 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

NATS.io is a high performance open source pub-sub distributed communication technology, built for the cloud, on-premise, IoT, and edge computing. The 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. In nkeys versions 0.4.0 through 0.4.5, corresponding with NATS server versions 2.10.0 through 2.10.3, the 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. This affects encryption only, not signing.  
FIXME: FILL IN IMPACT ON NATS-SERVER AUTH CALLOUT SECURITY. nkeys Go library 0.4.6, corresponding with NATS Server 2.10.4, has a patch for this issue. No known workarounds are available. For any application handling auth callouts in Go, if using the nkeys library, update the dependency, recompile and deploy that in lockstep.

Weakness: CWE-325 (Missing Cryptographic Step), CWE-321 (Use of Hard-coded Cryptographic Key)

## Which versions are affected by CVE-2023-46129?

6 open source packages ship an affected version, including github.com/nats-io/nkeys, nats and github.com/nats-io/nats-server/v2. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/nats-io/nkeys` | Go | From 0.4.0 | 0.4.6 |
| `github.com/nats-io/nkeys` | Go | From 0.4.0 | 0.4.6 |
| `github.com/nats-io/nkeys` | Go | From 0.4.0 | 0.4.6 |
| `nats` | Bitnami | From 2.10.0 | 2.10.4 |
| `github.com/nats-io/nats-server/v2` | Go | From 2.10.0 | 2.10.4 |
| `github.com/nats-io/nats-server/v2` | Go | From 2.10.0 | 2.10.4 |

Products: Linuxfoundation Nats-Server, Nats Nkeys.

## How do I fix CVE-2023-46129?

Upgrade github.com/nats-io/nkeys to 0.4.6 or later.

## Is CVE-2023-46129 being exploited?

There is no known exploitation of CVE-2023-46129 in the wild and no public exploit code.

## Other vulnerabilities in nats-io nkeys

- [CVE-2022-28357](https://insights.sbomify.com/CVE-2022-28357/): NATS nats-server allows directory traversal via unintended path to a management action (critical 9.8)
- [CVE-2026-58253](https://insights.sbomify.com/CVE-2026-58253/): NATS Server: Route API Auth Bypass (high 8.8)
- [CVE-2022-24450](https://insights.sbomify.com/CVE-2022-24450/): Incorrect Authorization in NATS nats-server (high 8.8)
- [CVE-2026-33216](https://insights.sbomify.com/CVE-2026-33216/): NATS has MQTT plaintext password disclosure (high 8.6)
- [CVE-2026-58207](https://insights.sbomify.com/CVE-2026-58207/): NATS Server: Remote crash via integer overflow in Connz pagination (high 7.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-46129 and fix it if it is affected.

What it is: CVE-2023-46129 is a high-severity vulnerability in nats-io nkeys, published on 30 Oct 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-46129 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/nats-io/nkeys (Go): affected from 0.4.0; fixed in 0.4.6
- github.com/nats-io/nkeys (Go): affected from 0.4.0; fixed in 0.4.6
- github.com/nats-io/nkeys (Go): affected from 0.4.0; fixed in 0.4.6
- nats (Bitnami): affected from 2.10.0; fixed in 2.10.4
- github.com/nats-io/nats-server/v2 (Go): affected from 2.10.0; fixed in 2.10.4
- github.com/nats-io/nats-server/v2 (Go): affected from 2.10.0; fixed in 2.10.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-46129/ (Markdown: https://insights.sbomify.com/CVE-2023-46129/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-46129
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-46129
- OSV: https://osv.dev/vulnerability/CVE-2023-46129

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-46129/
Summaries are generated and may contain mistakes; the official description above is the record.
