CVE-2023-38961

9.8 CRITICAL

📋 TL;DR

A buffer overflow vulnerability in JerryScript v3.0.0 allows remote attackers to execute arbitrary code by exploiting the scanner_is_context_needed component. This affects systems running vulnerable versions of JerryScript, potentially leading to complete system compromise. The vulnerability is particularly dangerous because it can be triggered remotely without authentication.

💻 Affected Systems

Products:
  • JerryScript
Versions: v3.0.0
Operating Systems: All platforms running JerryScript
Default Config Vulnerable: ⚠️ Yes
Notes: Any application or device using JerryScript v3.0.0 for JavaScript parsing/execution is vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to full system compromise, data exfiltration, and persistent backdoor installation.

🟠

Likely Case

Application crash leading to denial of service, with potential for limited code execution in constrained environments.

🟢

If Mitigated

Application crash with no code execution if memory protections (ASLR, DEP) are properly implemented.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

The vulnerability requires crafting malicious JavaScript input but doesn't require authentication.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v3.0.1 or later

Vendor Advisory: https://github.com/jerryscript-project/jerryscript/issues/5092

Restart Required: Yes

Instructions:

1. Check current JerryScript version. 2. Update to v3.0.1 or later via package manager or source compilation. 3. Restart all services using JerryScript. 4. Verify the update was successful.

🔧 Temporary Workarounds

Input Validation

all

Implement strict input validation and sanitization for JavaScript input to JerryScript

Memory Protection

linux

Enable ASLR and DEP/PaX/NX protections at OS level

sysctl -w kernel.randomize_va_space=2

🧯 If You Can't Patch

  • Isolate JerryScript instances in containers or VMs with minimal privileges
  • Implement network segmentation to restrict access to vulnerable systems

🔍 How to Verify

Check if Vulnerable:

Check JerryScript version: jerry --version or examine package manager output

Check Version:

jerry --version

Verify Fix Applied:

Verify version is v3.0.1 or later and test with known safe JavaScript inputs

📡 Detection & Monitoring

Log Indicators:

  • Segmentation fault errors
  • Memory access violation logs
  • Unexpected process termination

Network Indicators:

  • Unusual JavaScript payloads in network traffic
  • Multiple connection attempts with malformed data

SIEM Query:

source="application.log" AND ("segmentation fault" OR "buffer overflow" OR "jerryscript")

🔗 References

📤 Share & Export