CVE-2021-3127: NATS Server Incorrect Access Control

nats Updated 02 Oct 2025

Summary

06/03/2024
Yes i
High
Not published

CVE-2021-3127: NATS Server 2.x before 2.2.0 and JWT library before 2.0.1 have Incorrect Access Control because Import Token bindings are mishandled. Affects nats versions >= 2.0.0, < 2.2.0. Fixed in 2.2.0. How to fix ↓

Also tracked for

The same CVE-2021-3127 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

NATS Server is a messaging system that provides a lightweight and high-performance solution for communication between distributed systems. It is widely used in cloud-native applications and microservices architectures. This vulnerability affects NATS Server version 2.x before 2.2.0 and the JWT library before 2.0.1. The vulnerability arises due to mishandling of Import Token bindings, leading to incorrect access control.

Vulnerability Detail

The vulnerability allows unauthorized access to NATS Server and JWT library. Attackers can exploit this vulnerability to bypass access controls and gain unauthorized privileges. This can result in unauthorized data access, data manipulation, or even a complete compromise of the affected system. The vulnerability is rated as high severity with a CVSS score of 8.1 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

How To Fix

Minimum fixed version

2.2.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to apply the recommended fixes by upgrading NATS Server and the JWT library to the specified versions.

Conclusion

NATS Server version 2.x before 2.2.0 and JWT library before 2.0.1 are vulnerable to an incorrect access control issue. This can lead to unauthorized access and potential compromise of the affected system. It is crucial to upgrade NATS Server and the JWT library to the recommended versions to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for nats →

Share this vulnerability

FAQ

NATS Server is a messaging system used for communication between distributed systems.

NATS Server 2.x before 2.2.0 and JWT library before 2.0.1 are affected.

The vulnerability allows unauthorized access and can lead to data compromise or system compromise.

Upgrade NATS Server to version 2.2.0 or later and update the JWT library to version 2.0.1 or later.

No, there is no known workaround. Applying the recommended fixes is necessary.

Related vulnerabilities

Recent vulnerabilities recorded for nats.

How To Fix

Minimum fixed version

2.2.0

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback