CVE-2021-3127

mediumPriorität · verfolgen · 31OT-Risiko · erhöhtEPSS 0.014 · 73. PerzentilEUUS
grimoire priorityP3 · Track
Exploitable?
—
no known exploitation
Likely / severe?
1.45% (73rd) EPSS
CVSS 5 · medium
Is it mine?
8 products
Prüfe deine Angriffsfläche
Who says so?
4 sources
cnnvd · enisa_euvd · osv · nvd

EPSS · bewertet 2026-10-27

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.

01

cvss

Technischer Schweregrad, 0–10. Eine Zeile je Quelle.

7.5
010

Basiswert 0–10 · höher = schwerwiegender · Vektor überfahren zum Auflösen⚠ Quellen uneinig · medium–high · 5–7.5

v2.05mediumAV:N/AC:L/Au:N/C:P/I:N/A:Nprimary · NVD / NIST USAusnutzbarkeit 10 · Auswirkung 2.9
v3.17.5highCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:Nprimary · NVD / NIST USAusnutzbarkeit 3.9 · Auswirkung 3.6
v3.17.5highCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:Nsecondary · OSV
v3.16.9mediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N/E:Usecondary · CVSS-BT (t0sche)
02

schwächen

Die CWE-Schwächeklassen, zu denen dies gehört.

03

betroffene Produkte (8)

Betroffene Produkte und Versionsbereiche.

04

Advisories (5)

Hersteller- und Ökosystem-Meldungen dazu.

  • GHSA-62mh-w5cv-p88cnats-io/jwt not enforcing checking of Import token permissions2022-02-15ghsa · osvUS

    (This advisory is canonically <https://advisories.nats.io/CVE/CVE-2021-3127.txt>) ## Problem Description The NATS server provides for Subjects which are namespaced by Account; all Subjects are supposed to be private to an account, with an Export/Import system used to grant cross-account access to some Subjects. Some Exports are public, such that anyone can import the relevant subjects, and some Exports are private, such that the Import requires a token JWT to prove permission. The JWT library's validation of the bindings in the Import Token incorrectly warned on mismatches, instead of outright rejecting the token. As a result, any account can take an Import token used by any other account and re-use it for themselves because the binding to the importing account is not rejected, and use it to import *any* Subject from the Exporting account, not just the Subject referenced in the Import Token. The NATS account-server system treats account JWTs as semi-public information, such that an attacker can easily enumerate all account JWTs and retrieve all Import Tokens from those account JWTs. The CVE identifier should cover the JWT library repair and the nats-server containing the fixed JWT library, and any other application depending upon the fixed JWT library. ## Affected versions #### JWT library * all versions prior to 2.0.1 * fixed after nats-io/jwt#149 landed (2021-03-14) #### NATS Server * Version 2 prior to 2.2.0 + 2.0.0 through and including 2.1.9 are vulnerable * fixed with nats-io/nats-server@423b79440c (2021-03-14) ## Impact In deployments with untrusted accounts able to update the Account Server with imports, a malicious account can access any Subject from an account which provides Exported Subjects. Abuse of this facility requires the malicious actor to upload their tampered Account JWT to the Account Server, providing the service operator with a data-store which can be scanned for signs of abuse. ## Workaround Deny access to clients to update their account JWT in the account server. ## Solution Upgrade the JWT dependency in any application using it. Upgrade the NATS server if using NATS Accounts (with private Exports; Account owners can create those at any time though). Audit all accounts JWTs to scan for exploit attempts; a Python script to audit the accounts can be found at <https://gist.github.com/philpennock/09d49524ad98043ff11d8a40c2bb0d5a>.

  • GHSA-9r5x-fjv3-q6h4Duplicate Advisory: Incorrect Access Control in github.com/nats-io/jwt and github.com/nats-io/nats-server/v22022-02-15ghsa · osvUS

    ## Duplicate Advisory This advisory has been withdrawn because it is a duplicate of GHSA-62mh-w5cv-p88c (for github.com/nats-io/jwt) and GHSA-j756-f273-xhp4 (for github.com/nats-io/nats-server). This link is maintained to preserve external references. ## Original Description NATS Server (github.com/nats-io/nats-server/v2/server) 2.x before 2.2.0 and JWT library (github.com/nats-io/jwt/v2) before 2.0.1 have Incorrect Access Control because Import Token bindings are mishandled.

  • GHSA-j756-f273-xhp4github.com/nats-io/nats-server Import token permissions checking not enforced2021-05-21ghsa · osvUS

    (This advisory is canonically <https://advisories.nats.io/CVE/CVE-2021-3127.txt>) ## Problem Description The NATS server provides for Subjects which are namespaced by Account; all Subjects are supposed to be private to an account, with an Export/Import system used to grant cross-account access to some Subjects. Some Exports are public, such that anyone can import the relevant subjects, and some Exports are private, such that the Import requires a token JWT to prove permission. The JWT library's validation of the bindings in the Import Token incorrectly warned on mismatches, instead of outright rejecting the token. As a result, any account can take an Import token used by any other account and re-use it for themselves because the binding to the importing account is not rejected, and use it to import *any* Subject from the Exporting account, not just the Subject referenced in the Import Token. The NATS account-server system treats account JWTs as semi-public information, such that an attacker can easily enumerate all account JWTs and retrieve all Import Tokens from those account JWTs. The CVE identifier should cover the JWT library repair and the nats-server containing the fixed JWT library, and any other application depending upon the fixed JWT library. ## Affected versions #### JWT library * all versions prior to 2.0.1 * fixed after nats-io/jwt#149 landed (2021-03-14) #### NATS Server * Version 2 prior to 2.2.0 + 2.0.0 through and including 2.1.9 are vulnerable * fixed with nats-io/nats-server@423b79440c (2021-03-14) ## Impact In deployments with untrusted accounts able to update the Account Server with imports, a malicious account can access any Subject from an account which provides Exported Subjects. Abuse of this facility requires the malicious actor to upload their tampered Account JWT to the Account Server, providing the service operator with a data-store which can be scanned for signs of abuse. ## Workaround Deny access to clients to update their account JWT in the account server. ## Solution Upgrade the JWT dependency in any application using it. Upgrade the NATS server if using NATS Accounts (with private Exports; Account owners can create those at any time though). Audit all accounts JWTs to scan for exploit attempts; a Python script to audit the accounts can be found at <https://gist.github.com/philpennock/09d49524ad98043ff11d8a40c2bb0d5a>.

  • BIT-nats-2021-31272024-03-06vendor · osvUS

    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.

  • GO-2022-0386Import token permissions checking not enforced in github.com/nats-io/jwt2022-07-01vendor · osvUS

    Import tokens valid for one account may be used for any other account. Validation of Import token bindings incorrectly warns on mismatches, rather than rejecting the Goken. This permits a token for one account to be used for any other account.

05

auch bekannt als (8)

Weitere Namen und Kennungen dieser Entität.

06

quellen

Welche Quellen diesen Datensatz belegen und wann.

veröffentlicht 2021-03-16geändert 2026-06-17
08

Referenzen (4)

Externe Belege — Patches, Meldungen, Analysen.

scry

Angreifer nutzen Schwachstellen wie diese gegen im Internet exponierte Dienste aus. Sehen Sie mit einem kostenlosen Passiv-Scan, was exponiert ist.

Kostenloser Scan