CVE-2020-26892

9.8 CRITICAL

📋 TL;DR

This vulnerability in NATS nats-server allows attackers to bypass authentication by using expired JWT credentials, potentially gaining unauthorized access to the messaging system. It affects all deployments using JWT authentication with nats-server versions before 2.1.9.

💻 Affected Systems

Products:
  • NATS nats-server
Versions: All versions before 2.1.9
Operating Systems: All platforms running NATS nats-server
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects systems using JWT authentication. Systems using other authentication methods or no authentication are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise where attackers gain administrative access to the NATS messaging system, allowing them to intercept, modify, or inject messages across all connected applications.

🟠

Likely Case

Unauthorized access to the messaging system enabling attackers to eavesdrop on sensitive data, inject malicious messages, or disrupt message flow between applications.

🟢

If Mitigated

Limited impact with proper network segmentation and additional authentication layers, though expired credentials could still be misused within the NATS system.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires obtaining expired JWT credentials, which could be gathered from logs, previous connections, or other sources.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.1.9 and later

Vendor Advisory: https://github.com/nats-io/nats-server/commits/master

Restart Required: Yes

Instructions:

1. Download nats-server version 2.1.9 or later from https://github.com/nats-io/nats-server/releases
2. Stop the current nats-server process
3. Replace the binary with the new version
4. Restart the nats-server service

🔧 Temporary Workarounds

Disable JWT Authentication

all

Temporarily switch to alternative authentication methods or disable authentication if not required

Modify nats-server configuration to remove JWT authentication settings

Network Segmentation

all

Restrict access to NATS server to trusted networks only

Configure firewall rules to limit inbound connections to NATS server

🧯 If You Can't Patch

  • Implement network-level authentication and encryption (TLS/mTLS) for all NATS connections
  • Deploy an API gateway or reverse proxy with additional authentication layers in front of NATS

🔍 How to Verify

Check if Vulnerable:

Check nats-server version with 'nats-server -v' and verify it's below 2.1.9, and confirm JWT authentication is enabled in configuration

Check Version:

nats-server -v

Verify Fix Applied:

After patching, verify version is 2.1.9 or higher with 'nats-server -v' and test that expired JWT tokens are properly rejected

📡 Detection & Monitoring

Log Indicators:

  • Authentication attempts with expired JWT tokens
  • Unexpected successful authentications
  • Access from unusual IP addresses

Network Indicators:

  • Unauthorized connections to NATS ports
  • Suspicious message patterns or injection attempts

SIEM Query:

source="nats-server" AND ("authentication failed" OR "JWT expired") | stats count by src_ip

🔗 References

📤 Share & Export