CVE-2021-3127: Incorrect Access Control in github.com/nats-io/jwt and github.com/nats-io/nats-server/v2

github.com/nats-io/jwt Updated 02 Oct 2025

Summary

01/07/2022
Yes i
Critical
Not published

CVE-2021-3127: Import token permissions checking not enforced in github.com/nats-io/jwt. Affects github.com/nats-io/jwt versions < 1.2.3-0.20210314221642-a826c77dc9d2. Fixed in 1.2.3-0.20210314221642-a826c77dc9d2. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The package under scrutiny is github.com/nats-io/jwt, which is a Go library for JSON Web Tokens (JWT). It provides functionality for creating, parsing, and validating JWTs. The vulnerability also affects github.com/nats-io/nats-server/v2, which is a Go implementation of the NATS messaging system. NATS Server 2.x before 2.2.0 and JWT library before 2.0.1 are impacted by an Incorrect Access Control issue. This vulnerability arises due to mishandling of Import Token bindings.

Vulnerability Detail

The Incorrect Access Control vulnerability in github.com/nats-io/jwt and github.com/nats-io/nats-server/v2 allows unauthorized access to Import Token bindings. This can lead to various security risks, such as unauthorized access to sensitive data or functionality. The vulnerability has a CVSS score of 7.5, indicating a high severity level. It is important to address this issue promptly to prevent potential exploitation.

How To Fix

Minimum fixed version

1.2.3-0.20210314221642-a826c77dc9d2

This is the first release that contains the fix.

go get github.com/nats-io/jwt@v1.2.3-0.20210314221642-a826c77dc9d2

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

Workaround

There is no specific workaround mentioned for this vulnerability. It is advised to follow the recommended fix and update the affected packages to the fixed versions.

Conclusion

In conclusion, the Incorrect Access Control vulnerability in github.com/nats-io/jwt and github.com/nats-io/nats-server/v2 can lead to unauthorized access to Import Token bindings, posing security risks. It is crucial to update the affected packages to the fixed versions to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/nats-io/jwt →

Share this vulnerability

FAQ

The vulnerability allows unauthorized access to Import Token bindings, which can result in unauthorized access to sensitive data or functionality.

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

The vulnerability affects github.com/nats-io/jwt and github.com/nats-io/nats-server/v2.

To fix this vulnerability, update the affected packages to their respective fixed versions: github.com/nats-io/jwt 2.0.1 or later, and github.com/nats-io/nats-server/v2 2.2.0 or later.

There is no specific workaround mentioned for this vulnerability. It is recommended to update the affected packages to the fixed versions.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/nats-io/jwt.

How To Fix

Minimum fixed version

1.2.3-0.20210314221642-a826c77dc9d2

This is the first release that contains the fix.

go get github.com/nats-io/jwt@v1.2.3-0.20210314221642-a826c77dc9d2

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