Vulnerability DatabaseGHSA-j756-f273-xhp4

GHSA-j756-f273-xhp4
vulnerability analysis and mitigation

Overview

The NATS server vulnerability (CVE-2021-3127) was discovered in NATS Server versions 2.x before 2.2.0 and JWT library before 2.0.1, affecting their Import Token permissions checking mechanism. The vulnerability was disclosed on March 15, 2021, and impacts the NATS server's account-based subject namespace system, specifically the Export/Import system used for cross-account access control (NATS Advisory, GitHub Advisory).

Technical details

The vulnerability stems from the JWT library's incorrect validation of bindings in Import Tokens. Instead of rejecting mismatched tokens, the system only generated warnings. This implementation flaw allows any account to reuse Import tokens from other accounts and access any Subject from the Exporting account, bypassing intended restrictions. The vulnerability has a CVSS v3.1 base score of 7.5 (High), with a vector string of CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N (NVD).

Impact

In deployments where untrusted accounts can update the Account Server with imports, malicious actors can gain unauthorized access to any Subject from accounts with Exported Subjects. The NATS account-server system's treatment of account JWTs as semi-public information makes it possible for attackers to enumerate all account JWTs and retrieve Import Tokens, though exploitation requires uploading tampered Account JWT to the Account Server (NATS Advisory).

Exploitability

The vulnerability is exploitable in environments where clients have access to update their account JWT in the account server. The exploitation process involves taking an Import token from any other account and reusing it, allowing access to any Subject from the Exporting account, not just the Subject referenced in the Import Token (GitHub Advisory).

Mitigation and workarounds

As an immediate workaround, administrators should deny access to clients to update their account JWT in the account server. For a permanent fix, users should upgrade the JWT dependency to version 2.0.1 or later in any application using it, and upgrade the NATS server to version 2.2.0 or later if using NATS Accounts with private Exports. Additionally, it's recommended to audit all accounts JWTs to scan for potential exploit attempts using the provided Python script (NATS Advisory).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management