Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Pre-authentication MQTT parser reachable over the network with a single crafted packet (AV:N/AC:L/PR:N/UI:N); impact is resource exhaustion, so A:H with C:N/I:N.
Primary rating from Vendor (vendor:ubuntu).
CVSS VectorVendor: vendor:ubuntu
Lifecycle Timeline
7DescriptionCVE.org
[Unknown description]
AnalysisAI
Denial of service in NATS Server (nats-server) MQTT handler allows a remote, unauthenticated client to exhaust server memory by sending an MQTT CONNECT packet that declares a large variable-length 'remaining length' before authentication completes. Because the pre-connection MQTT parser failed to enforce the configured max_payload limit, the server would buffer attacker-controlled data unbounded, degrading or crashing the broker (CVSS 7.5, availability-only impact). There is no public exploit identified at time of analysis and it is not listed in CISA KEV, but the fix is confirmed by upstream commits, releases, and a GitHub Security Advisory.
Technical ContextAI
NATS Server is a CNCF messaging system that, in addition to its native protocol, exposes an optional MQTT 3.1.1 listener. MQTT packets begin with a fixed header whose second element is a variable-length integer ('remaining length') indicating the size of the rest of the packet. The affected code path in server/mqtt.go (mqttParse → mqttReader.readPacketLen/readPacketLenWithCheck) parsed and accumulated inbound bytes for a not-yet-connected client without applying the server's max_payload cap, an instance of CWE-400 (Uncontrolled Resource Consumption). The patched code introduces readVarInt plus a maxLen parameter (int32(jwt.NoLimit) once connected, otherwise atomic c.mpay), returns ErrMaxPayload when the computed packet length exceeds the limit, and triggers maxPayloadViolation to disconnect the offending client - while a separate test (TestMQTTMaxPayloadDoesNotCapPublishTopic) confirms the cap must not wrongly restrict legitimate publish topics.
RemediationAI
Vendor-released patch: upgrade nats-server to v2.12.12 (https://github.com/nats-io/nats-server/releases/tag/v2.12.12) or v2.14.3 (https://github.com/nats-io/nats-server/releases/tag/v2.14.3), which enforce the max_payload limit during pre-connection MQTT parsing (fixing commits bce9ef39469e610aeddb819194ceb7f7edfc0861 and e016e47bbf70304945f2ae9dc397e4862adefaf5). If immediate patching is not possible, the most effective compensating control is to disable the MQTT listener (remove the mqtt {} block) where it is not required, which eliminates the vulnerable code path entirely but breaks any MQTT clients; where MQTT is needed, restrict the MQTT port to trusted networks via firewall/security-group rules and place it behind an authenticating proxy or mTLS to reduce unauthenticated reachability, at the cost of added connection overhead. Setting a conservative max_payload does not fully mitigate the pre-authentication case on unpatched servers, so network restriction plus upgrade is the correct combination; see the advisory GHSA-r72h-j7qq-v6qg for details.
More in Nats Server
View allNATS Server 2.x before 2.2.0 and JWT library before 2.0.1 have Incorrect Access Control because Import Token bindings ar
The JWT library in NATS nats-server before 2.1.9 has Incorrect Access Control because of how expired credentials are han
This affects all versions of package github.com/nats-io/nats-server/server. Rated high severity (CVSS 7.5), this vulnera
NATS nats-server before 2.7.2 has Incorrect Access Control. Rated high severity (CVSS 8.8), this vulnerability is remote
Authentication bypass in NATS Server (nats-io/nats-server) lets an unauthenticated attacker on an adjacent network conne
Remote denial of service in the NATS Server (nats-io/nats-server) leafnode subsystem allows unauthenticated attackers to
An integer overflow in NATS Server before 2.0.2 allows a remote attacker to crash the server by sending a crafted reques
Remote denial-of-service in NATS Server (nats-server) affects deployments with the WebSocket listener enabled but MQTT d
NATS.io is a high performance open source pub-sub distributed communication technology, built for the cloud, on-premise,
The JWT library in NATS nats-server before 2.1.9 allows a denial of service (a nil dereference in Go code). Rated high s
Protocol injection in NATS Server MQTT support allows an authenticated MQTT client to smuggle control characters (tab, n
NATS nats-server before 2.7.4 allows Directory Traversal (with write access) via an element in a ZIP archive for JetStre
Same weakness CWE-400 – Uncontrolled Resource Consumption
View allSame technique Denial Of Service
View allVendor StatusVendor
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-42348