Update module github.com/nats-io/nats-server/v2 to v2.10.27 [SECURITY] #36
+29
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v2.9.17→v2.10.27GitHub Vulnerability Alerts
CVE-2023-47090
Background
NATS.io is a high performance open source pub-sub distributed communication technology, built for the cloud, on-premise, IoT, and edge computing.
NATS users exist within accounts, and once using accounts, the old authorization block is not applicable.
Problem Description
Without any authorization rules in the nats-server, users can connect without authentication.
Before nats-server 2.2.0, all authentication and authorization rules for a nats-server lived in an "authorization" block, defining users. With nats-server 2.2.0 all users live inside accounts. When using the authorization block, whose syntax predates this, those users will be placed into the implicit global account, "$G". Users inside accounts go into the newer "accounts" block.
If an "accounts" block is defined, in simple deployment scenarios this is often used only to enable client access to the system account. When the only account added is the system account "$SYS", the nats-server would create an implicit user in "$G" and set it as the
no_auth_useraccount, enabling the same "without authentication" logic as without any rules.This preserved the ability to connect simply, and then add one authenticated login for system access.
But with an "authorization" block, this is wrong. Users exist in the global account, with login rules. And in simple testing, they might still connect fine without administrators seeing that authentication has been disabled.
The blind-spot on our part came from encouraging and documenting a switch to using only "accounts", instead of "authorization".
In the fixed versions, using an "authorization" block will inhibit the implicit creation of a "$G" user and setting it as the
no_auth_usertarget. In unfixed versions, just creating a second account, with no users, will also inhibit this behavior.Affected versions
NATS Server:
Workarounds
In the "accounts" block, define a second non-system account, leave it empty.
Solution
Any one of these:
Credits
Problem reported by Alex Herrington.
Addressed publicly in a GitHub Discussion prior to this advisory.
CVE-2025-30215
Advisory
The management of JetStream assets happens with messages in the
$JS.subject namespace in the system account; this is partially exposed into regular accounts to allow account holders to manage their assets.Some of the JS API requests were missing access controls, allowing any user with JS management permissions in any account to perform certain administrative actions on any JS asset in any other account. At least one of the unprotected APIs allows for data destruction. None of the affected APIs allow disclosing stream contents.
Affected versions
NATS Server:
Original Report
(Lightly edited to confirm some supposition and in the summary to use past tense)
Summary
nats-server did not include authorization checks on 4 separate admin-level JetStream APIs: account purge, server remove, account stream move, and account stream cancel-move.
In all cases, APIs are not properly restricted to system-account users. Instead, any authorized user can execute the APIs, including across account boundaries, as long as the current user merely has permission to publish on
$JS.>.Only the first seems to be of highest severity. All are included in this single report as they seem likely to have the same underlying root cause.
Reproduction of the
ACCOUNT.PURGEcase is below. The others are like it.Details & Impact
Issue 1:
$JS.API.ACCOUNT.PURGE.*Any user may perform an account purge of any other account (including their own).
Risk: total destruction of Jetstream configuration and data.
Issue 2:
$JS.API.SERVER.REMOVEAny user may remove servers from Jetstream clusters.
Risk: Loss of data redundancy, reduction of service quality.
Issue 3:
$JS.API.ACCOUNT.STREAM.MOVE.*.*andCANCEL_MOVEAny user may cause streams to be moved between servers.
Risk: loss of control of data provenance, reduced service quality during move, enumeration of account and/or stream names.
Similarly for
$JS.API.ACCOUNT.STREAM.CANCEL_MOVE.*.*Mitigations
It appears that users without permission to publish on
$JS.API.ACCOUNT.>or$JS.API.SERVER.>are unable to execute the above APIs.Unfortunately, in many configurations, an 'admin' user for a single account will be given permissions for
$JS.>(or simply>), which allows the improper access to the system APIs above.Scope of impact
Issues 1 and 3 both cross boundaries between accounts, violating promised account isolation. All 3 allow system level access to non-system account users.
While I cannot speak to what authz configurations are actually found in the wild, per the discussion in Mitigations above, it seems likely that at least some configurations are vulnerable.
Additional notes
It appears that
$JS.API.META.LEADER.STEPDOWNdoes properly restrict to system account users. As such, this may be a pattern for how to properly authorize these other APIs.PoC
Environment
Tested with:
nats-server 2.10.26 (installed via homebrew)
nats cli 0.1.6 (installed via homebrew)
macOS 13.7.4
Reproduction steps
Release Notes
nats-io/nats-server (github.com/nats-io/nats-server/v2)
v2.10.27Compare Source
Changelog
Go Version
CVEs
Fixed
JetStream
Complete Changes
v2.10.26Compare Source
Changelog
Refer to the 2.10 Upgrade Guide for backwards compatibility notes with 2.9.x.
Go Version
Dependencies
Added
General
no_fast_producer_stallallows disabling the stall gates, instead preferring to drop messages to consumers that would have resulted in a stall instead (#6500)first_info_timeoutto control how long a leafnode connection should wait for the initial connection info, useful for high latency links (#5424)Monitoring
gatewayzmonitoring endpoint can now return subscription information (#6525)raftzandipqueueszendpoints are now exposed via the system account as well (#6439)Improved
General
JetStream
healthzto be more descriptive about why the healthcheck failed (#6416)Monitoring
routezendpoint now reportspending_bytes(#6476)Fixed
General
max_closed_clientsoption is now parsed correctly from the server configuration file (#6497)JetStream
index.dbto not be recovered correctly after a restart (#6515)Leafnodes
WebSockets
Tests
Complete Changes
v2.10.25Compare Source
Changelog
Refer to the 2.10 Upgrade Guide for backwards compatibility notes with 2.9.x.
Go Version
Dependencies
Improved
JetStream
Fixed
JetStream
AckAllpolicy after a server restart (#6392)Leafnodes
Tests
Complete Changes
v2.10.24Compare Source
Changelog
Refer to the 2.10 Upgrade Guide for backwards compatibility notes with 2.9.x.
CVEs
x/crypto, although the NATS Server does not use the affected functionality and is therefore not vulnerableGo Version
Dependencies
Fixed
General
allow_responsespermission is now pruned more regularly, fixing performance issues that can get worse over time (#6064)JetStream
healthzand healthchecks (#6247, #6248, #6232)WebSockets
Complete Changes
v2.10.23Compare Source
Changelog
Refer to the 2.10 Upgrade Guide for backwards compatibility notes with 2.9.x.
Go Version
Dependencies
Added
JetStream
Windows
ca_certs_matchoption has been added in thetlsblock for searching the certificate store for only certificates matching the specified CAs (#5115)cert_match_skip_invalidoption has been added in thetlsblock for ignoring certificates that have expired or are not valid yet (#6042)cert_match_byoption can now be set tothumbprint, allowing an SHA1 thumbprint to be specified incert_match(#6042, #6047)Improved
JetStream
Fixed
General
JetStream
Backoffconfiguration option now correctly checks theMaxDeliveryconstraint (#6154)Leafnodes
WebSockets
Windows
LocalMachinecertificate store is now possible from a non-administrator user (#6019)Tests
Complete Changes
v2.10.22Compare Source
Changelog
Refer to the 2.10 Upgrade Guide for backwards compatibility notes with 2.9.x.
Go Version
Dependencies
Added
Config
Improved
General
JetStream
Fixed
JetStream
Leafnodes
Complete Changes
v2.10.21Compare Source
Changelog
Refer to the 2.10 Upgrade Guide for backwards compatibility notes with 2.9.x.
Go Version
Dependencies
Added
Config
min_versionoption for configuring the minimum supported TLS version (#5904)Improved
JetStream
Monitoring
statszmessages are now sent every 10 seconds instead of every 30 seconds (#5925)statszmessages andjszresponses for monitoring (#5923, #5926)Fixed
JetStream
index.db(#5893, #5901, #5907)Monitoring
accountsz(#5886)OCSP
Config
Complete Changes
v2.10.20Compare Source
Changelog
Refer to the 2.10 Upgrade Guide for backwards compatibility notes with 2.9.x.
Go Version
Fixed
JetStream
Complete Changes
v2.10.19Compare Source
Changelog
Refer to the 2.10 Upgrade Guide for backwards compatibility notes with 2.9.x.
Go Version
Dependencies
Improved
General
statszandprofilezsystem events (#5816)Clustering
JetStream
sync/sync_intervalis set toalways, metadata files for streams and consumers are now written usingO_SYNCto guarantee flushes to disk (#5729)Monitoring
profilezAPI endpoint in the system account can now acquire and return CPU profiles (#5743)Miscellaneous
Fixed
General
ClientURL()function now returns correctly formatted IPv6 host literals (#5725)Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.