github.com/nats-io/nats-server/v2
Affected
- introduced
2.2.0, fixed2.7.4(semver)
Fixed versions
2.7.4
Fix
- Fixed version
2.7.4go get github.com/nats-io/nats-server/[email protected]
Advisory
Also known as: BIT-nats-2022-26652, CVE-2022-26652, GO-2022-0351
Arbitrary file write in nats-server
(This document is canonically: https://advisories.nats.io/CVE/CVE-2022-26652.txt)
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:
NATS Streaming Server
Workarounds
Solution
Upgrade the NATS server to at least 2.7.4.
We fully support the util/nats-server-hardened.service configuration for running a NATS server and encourage this approach.
Credits
This issue was reported (on 2022-03-07) to the NATS Maintainers by
Yiming Xiang, TIANJI LAB of NSFOCUS.
Thank you / 谢谢你!
High Basis: The source's own band: HIGH
2.2.0, fixed 2.7.4 (semver)2.7.4
2.7.4go get github.com/nats-io/nats-server/[email protected]0.15.0, fixed 0.24.3 (semver)0.24.3
0.24.3go get github.com/nats-io/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0