CVE-2022-26652
Medium · 6.5CVSS
6.5
EPSS
2.3%
Published
Mar 10, 2022
CISA due date
—
Cloudanix analysis
A flaw in the NATS messaging server could let authorized users write files anywhere on the system by sending specially crafted data packages.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Data Tampering
- Component
- Network Service
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Allows an authenticated user with write access to JetStream streams to perform directory traversal by including malicious elements in a ZIP archive, potentially writing files outside the intended directory.
Why it matters to the business
Attackers could overwrite critical configuration or data files on the server, leading to service disruption, data corruption, or unauthorized access to sensitive information.
How an attack unfolds
An attacker with valid credentials and JetStream write permissions crafts a ZIP archive containing path traversal sequences like ../ in file names, uploads it via the JetStream API, causing the server to extract files to unintended locations on the filesystem.
How to fix it
Upgrade nats-server to the version containing commit a86b84a9f35168973d910f462b8d03f77699b34f or later. For nats-streaming-server, upgrade to 0.24.3 or later.
How to confirm the fix worked
Verify the server version is at least the fixed commit. Monitor JetStream stream operations for unexpected file writes.
Typical attack path
- Obtain valid NATS credentials with JetStream permissions
- Create a malicious ZIP archive with directory traversal payloads
- Upload the archive to a JetStream stream
- Trigger extraction to write files to arbitrary paths
- Achieve persistence or disrupt operations
How to detect it
Examine NATS server logs for JetStream stream creation or message uploads containing ZIP archives. Look for unexpected file modifications in directories outside the data store.
What your security team should do
- Immediately upgrade affected NATS servers to the fixed version
- Review and restrict JetStream permissions to least privilege
- Implement file integrity monitoring on the server filesystem
- Audit logs for suspicious stream uploads
The record
NATS nats-server before 2.7.4 allows Directory Traversal (with write access) via an element in a ZIP archive for JetStream streams. nats-streaming-server before 0.24.3 is also affected.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Go | github.com/nats-io/nats-server | 0 | No fix |
| Go | github.com/nats-io/nats-server/v2 | 2.2.0 | 2.7.4 |
| Go | github.com/nats-io/nats-streaming-server | 0.15.0 | 0.24.3 |
| Bitnami | nats | 2.2.0 | 2.7.4 |
| go | github.com/nats-io/nats-server/v2 | v2.2.0 | v2.7.4 |
| go | github.com/nats-io/nats-streaming-server | v0.15.0 | v0.24.3 |
Related vulnerabilities
- CVE-2026-27571 NATS-Server is a High-Performance server for NATS.io, a cloud and edge native messaging… Also affects github.com/nats-io/nats-server
- CVE-2022-29946 NATS.io NATS Server before 2.8.2 and Streaming Server before 0.24.6 could allow a remote… Also affects github.com/nats-io/nats-server
- CVE-2022-24450 NATS nats-server before 2.7.2 has Incorrect Access Control. Also affects github.com/nats-io/nats-server
- CVE-2025-30215 NATS-Server is a High-Performance server for NATS.io, the cloud and edge native messaging… Also affects github.com/nats-io/nats-server/v2
- CVE-2023-46129 NATS.io is a high performance open source pub-sub distributed communication technology… Also affects github.com/nats-io/nats-server/v2
- CVE-2026-108327 Tanium addressed a path traversal vulnerability in Tanium Data Service. CWE-22
- CVE-2026-121542 In Docker Buildx versions v0.19.0 through v0.38.0, an untrusted Bake definition may… CWE-22
- CVE-2026-63502 Yeti bridges the gap between CTI and DFIR practitioners by providing a Forensics… CWE-22