CVE-2021-32163

9.8 CRITICAL

📋 TL;DR

CVE-2021-32163 is an authentication vulnerability in MOSN v0.23.0 that allows attackers to bypass JWT authorization checks through case-sensitive string comparison issues. This enables privilege escalation where unauthorized users can gain access to protected resources. Only systems running MOSN v0.23.0 with JWT authentication enabled are affected.

💻 Affected Systems

Products:
  • MOSN (Modular Open Smart Network)
Versions: v0.23.0 only
Operating Systems: All platforms running MOSN
Default Config Vulnerable: ✅ No
Notes: Only vulnerable when JWT authentication is configured and enabled in MOSN.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers gain administrative privileges, access sensitive data, execute arbitrary commands, and fully compromise the MOSN instance and downstream services.

🟠

Likely Case

Unauthorized access to protected APIs and services behind MOSN, potentially leading to data exposure and lateral movement within the network.

🟢

If Mitigated

Limited impact with proper network segmentation and additional authentication layers, though the vulnerability still exists at the MOSN level.

🌐 Internet-Facing: HIGH - Internet-facing MOSN instances with JWT authentication are directly exploitable without authentication.
🏢 Internal Only: HIGH - Internal instances are equally vulnerable if attackers gain network access or through insider threats.

🎯 Exploit Status

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

Exploitation requires sending specially crafted JWT tokens with case variations to bypass authorization checks. The vulnerability is simple to exploit once identified.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v0.23.1 and later

Vendor Advisory: https://github.com/mosn/mosn/issues/1633

Restart Required: Yes

Instructions:

1. Stop MOSN service. 2. Update MOSN to v0.23.1 or later using package manager or manual installation. 3. Restart MOSN service. 4. Verify the update with 'mosn version' command.

🔧 Temporary Workarounds

Disable JWT Authentication

all

Temporarily disable JWT authentication in MOSN configuration if not critically required.

Edit MOSN configuration file and remove or comment JWT authentication settings
Restart MOSN: systemctl restart mosn

Implement Additional Authentication Layer

all

Add network-level authentication (IP whitelisting) or application-level authentication before MOSN.

Configure firewall rules to restrict access
Implement API gateway with additional auth

🧯 If You Can't Patch

  • Implement strict network segmentation to isolate MOSN instances from untrusted networks
  • Deploy Web Application Firewall (WAF) with JWT validation rules to block exploitation attempts

🔍 How to Verify

Check if Vulnerable:

Check MOSN version with 'mosn version' command. If output shows v0.23.0 and JWT authentication is configured, the system is vulnerable.

Check Version:

mosn version

Verify Fix Applied:

After patching, run 'mosn version' to confirm version is v0.23.1 or later. Test JWT authentication with case variations to ensure proper validation.

📡 Detection & Monitoring

Log Indicators:

  • Failed JWT authentication attempts with case variations in token fields
  • Successful authentication from unexpected sources
  • Authorization header manipulation patterns

Network Indicators:

  • HTTP requests with modified JWT tokens containing case variations
  • Unusual authentication patterns to MOSN endpoints

SIEM Query:

source="mosn" AND ("jwt" OR "authorization") AND ("case" OR "failed auth" OR "unauthorized access")

🔗 References

📤 Share & Export