CVE-2024-13903

4.3 MEDIUM

📋 TL;DR

This CVE describes a stack-based buffer overflow vulnerability in quickjs-ng QuickJS JavaScript engine versions up to 0.8.0. The vulnerability in the JS_GetRuntime function allows remote attackers to potentially execute arbitrary code or cause denial of service. Systems using vulnerable versions of quickjs-ng for JavaScript execution are affected.

💻 Affected Systems

Products:
  • quickjs-ng QuickJS
Versions: Versions up to and including 0.8.0
Operating Systems: All platforms where quickjs-ng is installed
Default Config Vulnerable: ⚠️ Yes
Notes: Any application or system using quickjs-ng for JavaScript execution is vulnerable if running affected versions.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or persistent backdoor installation.

🟠

Likely Case

Denial of service through application crashes or instability in JavaScript execution environments.

🟢

If Mitigated

Limited impact due to sandboxing or isolation mechanisms preventing memory corruption from affecting the host system.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: LOW

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Remote exploitation is possible but requires specific conditions to trigger the buffer overflow.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.9.0

Vendor Advisory: https://github.com/quickjs-ng/quickjs/releases/tag/v0.9.0

Restart Required: Yes

Instructions:

1. Identify all systems using quickjs-ng
2. Check current version with 'qjs --version' or equivalent
3. Upgrade to version 0.9.0 or later using package manager or manual compilation
4. Restart any services using quickjs-ng
5. Verify the fix with version check

🔧 Temporary Workarounds

Disable JavaScript execution

all

Temporarily disable quickjs-ng JavaScript execution if not essential

# System-specific commands to disable quickjs-ng services

Network isolation

all

Restrict network access to systems using quickjs-ng

# Use firewall rules to limit inbound connections

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for JavaScript code processed by quickjs-ng
  • Deploy memory protection mechanisms like ASLR and stack canaries if not already enabled

🔍 How to Verify

Check if Vulnerable:

Check quickjs-ng version with 'qjs --version' or examine package manager output. Versions ≤0.8.0 are vulnerable.

Check Version:

qjs --version

Verify Fix Applied:

Confirm version is ≥0.9.0 with 'qjs --version' and test JavaScript execution functionality.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes or abnormal termination of quickjs-ng processes
  • Memory access violation errors in system logs
  • Unusual JavaScript execution patterns

Network Indicators:

  • Unexpected network connections from quickjs-ng processes
  • Traffic patterns suggesting exploitation attempts

SIEM Query:

process_name:"qjs" AND (event_type:"crash" OR memory_violation)

🔗 References

📤 Share & Export