CVE-2021-45005

9.8 CRITICAL

📋 TL;DR

CVE-2021-45005 is a heap buffer overflow vulnerability in Artifex MuJS v1.1.3 caused by conflicting JumpList handling in nested try/finally statements. This allows attackers to execute arbitrary code or cause denial of service. Anyone using MuJS v1.1.3 in applications is affected.

💻 Affected Systems

Products:
  • Artifex MuJS
Versions: v1.1.3 specifically
Operating Systems: All platforms running MuJS
Default Config Vulnerable: ⚠️ Yes
Notes: Any application embedding MuJS v1.1.3 is vulnerable when processing JavaScript with nested try/finally statements.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

Application crash causing denial of service, potentially leading to data corruption.

🟢

If Mitigated

Controlled crash with minimal impact if proper memory protections and sandboxing are implemented.

🌐 Internet-Facing: HIGH - If MuJS is used in web applications or services exposed to untrusted input.
🏢 Internal Only: MEDIUM - Lower exposure but still risky if processing untrusted scripts internally.

🎯 Exploit Status

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

Proof of concept exists in bug reports. Exploitation requires crafting malicious JavaScript with specific try/finally patterns.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in commit df8559e7bdbc6065276e786217eeee70f28fce66 and later versions

Vendor Advisory: https://bugs.ghostscript.com/show_bug.cgi?id=704749

Restart Required: Yes

Instructions:

1. Update MuJS to version after commit df8559e7. 2. Recompile any applications using MuJS. 3. Restart affected services.

🔧 Temporary Workarounds

Input Validation

all

Sanitize JavaScript input to reject scripts with deeply nested try/finally statements.

Memory Protection

linux

Enable ASLR and DEP to reduce exploit success probability.

sysctl -w kernel.randomize_va_space=2

🧯 If You Can't Patch

  • Isolate MuJS instances in containers or sandboxes with minimal privileges.
  • Implement network segmentation to limit access to vulnerable services.

🔍 How to Verify

Check if Vulnerable:

Check if MuJS version is exactly 1.1.3 or if application uses commit before df8559e7.

Check Version:

mujs --version or check build/commit hash in source

Verify Fix Applied:

Verify MuJS version is after commit df8559e7 and test with known proof-of-concept scripts.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes with memory access violations
  • Unusual JavaScript parsing errors

Network Indicators:

  • Unexpected JavaScript payloads with nested try/finally patterns

SIEM Query:

source="*mujs*" AND (event_type="crash" OR error="segmentation fault")

🔗 References

📤 Share & Export