CVE-2023-50044

9.8 CRITICAL

📋 TL;DR

CVE-2023-50044 is an out-of-bounds read vulnerability in Cesanta MJS 2.20.0 that occurs when built-in API names appear as substrings in input strings. This allows attackers to read memory beyond allocated buffers, potentially leading to information disclosure or crash. Any system using the vulnerable MJS JavaScript engine is affected.

💻 Affected Systems

Products:
  • Cesanta MJS
Versions: 2.20.0
Operating Systems: All platforms where MJS is deployed
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects MJS 2.20.0 specifically. Earlier versions are not vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Memory corruption leading to remote code execution, complete system compromise, or sensitive information disclosure.

🟠

Likely Case

Application crash (denial of service) or limited information disclosure from adjacent memory.

🟢

If Mitigated

Application crash with no data loss if proper sandboxing and privilege separation are implemented.

🌐 Internet-Facing: HIGH - Exploitable remotely without authentication via crafted input.
🏢 Internal Only: MEDIUM - Requires attacker access to internal systems or user interaction.

🎯 Exploit Status

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

Proof of concept demonstrates crash via crafted input. Full weaponization for RCE would require additional exploitation techniques.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.20.1

Vendor Advisory: https://github.com/cesanta/mjs/issues/254

Restart Required: Yes

Instructions:

1. Update MJS to version 2.20.1 or later. 2. Recompile any applications using MJS. 3. Restart affected services.

🔧 Temporary Workarounds

Input validation

all

Validate and sanitize all input strings before passing to MJS engine

Disable affected functionality

all

Disable or restrict use of built-in API features if not required

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all user-provided strings
  • Deploy MJS in sandboxed environment with minimal privileges

🔍 How to Verify

Check if Vulnerable:

Check if MJS version is exactly 2.20.0. Test with proof-of-concept input containing built-in API names as substrings.

Check Version:

Check application dependencies or compile configuration for MJS version

Verify Fix Applied:

Verify MJS version is 2.20.1 or later. Test with same proof-of-concept input to confirm no crash.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes
  • Memory access violation errors
  • Unexpected termination of MJS processes

Network Indicators:

  • Unusual input patterns containing API names
  • Repeated connection attempts to MJS endpoints

SIEM Query:

Process termination events from MJS applications OR memory violation alerts

🔗 References

📤 Share & Export