Path Traversal in github.com/nats-io/nats-server/v2 (CVE-2022-26652)
Summary
Path traversal in github.com/nats-io/nats-server/v2 (CVE-2022-26652). Data can be tampered with by attackers. Mitigation: upgrade to 2.7.4 or later.
Original description
The description as published by the source.
(This document is canonically: )
Background
NATS.io is a high performance open source pub-sub distributed communication technology, built for the cloud, on-premise, IoT, and edge computing.
JetStream is the optional RAFT-based resilient persistent feature of NATS.
Problem Description
The JetStream streams can be backed up and restored via NATS. The backup format is a tar archive file. Inadequate checks on the filenames within the archive file permit a so-called "Zip Slip" attack in the stream restore.
NATS nats-server through 2022-03-09 (fixed in release 2.7.4) did not correctly sanitize elements of the archive file, thus a user of NATS
could cause the NATS server to write arbitrary content to an attacker-controlled filename.
Affected versions
NATS Server:
- 2.2.0 up to and including 2.7.3.
- Introduced with JetStream Restore functionality
- Fixed with nats-io/nats-server: 2.7.4
- Docker image: nats
- NB users of OS package files from our releases: a change in goreleaser defaults, discovered late in the release process, moved the install directory from /usr/local/bin to /usr/bin; we are evaluating the correct solution for subsequent releases, but not recutting this release.
NATS Streaming Server
- 0.15.0 up to and including 0.24.2
- Fixed with nats-io/nats-streaming-server: 0.24.3
- Embeds a nats-server, but this server is the old approach which JetStream replaces, so unlikely (but not impossible) to be
configured with JS support
Workarou…
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2022-26652 has been found in github.com/nats-io/nats-server/v2.
Data can be tampered with by attackers.
What to do: upgrade github.com/nats-io/nats-server/v2 to 2.7.4 or later.
If unsure, ask your IT team or search "github.com/nats-io/nats-server/v2 CVE-2022-26652" on the vendor's site.
CVE-2022-26652 (github.com/nats-io/nats-server/v2) — CWE-22
Attack vector: remote (network-reachable) / no user interaction
Patched: 2.7.4 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Path traversal (CWE-22) exists in github.com/nats-io/nats-server/v2.
Check the vendor advisory for the affected versions of github.com/nats-io/nats-server/v2.
Severity: ?. Data can be tampered with by attackers.
Update to 2.7.4.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'github.com/nats-io/nats-server/v2' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'github.com/nats-io/nats-server/v2' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
github.com/nats-io/nats-server/v2を grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade github.com/nats-io/nats-server/v2 to 2.7.4ステージング環境で 2.7.4 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com
- web advisories.nats.io
- web github.com
- web github.com
- web github.com
- web openwall.com