CVE-2020-29657

9.1 CRITICAL

📋 TL;DR

CVE-2020-29657 is an out-of-bounds read vulnerability in JerryScript 2.3.0's main-utils.c file that could allow attackers to read sensitive memory contents or cause denial of service. This affects systems using JerryScript, a lightweight JavaScript engine for embedded devices. The vulnerability is particularly concerning for IoT devices and embedded systems running vulnerable JerryScript versions.

💻 Affected Systems

Products:
  • JerryScript
Versions: Version 2.3.0 specifically
Operating Systems: All platforms running JerryScript
Default Config Vulnerable: ⚠️ Yes
Notes: Any device or application using JerryScript 2.3.0 is vulnerable. JerryScript is commonly used in IoT devices, embedded systems, and resource-constrained environments.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, memory disclosure of sensitive data, or persistent denial of service.

🟠

Likely Case

Application crash causing denial of service, potential information disclosure through memory reads.

🟢

If Mitigated

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

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

The vulnerability is in the main_print_unhandled_exception function which handles exceptions, making it accessible during normal script execution. Proof of concept exists in the GitHub issue.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: JerryScript 2.4.0 and later

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

Restart Required: Yes

Instructions:

1. Update JerryScript to version 2.4.0 or later. 2. Recompile any applications using JerryScript. 3. Restart affected services or devices.

🔧 Temporary Workarounds

Disable exception printing

all

Modify code to avoid calling main_print_unhandled_exception function

Modify main-utils.c to remove or bypass the vulnerable function call

Memory protection hardening

linux

Enable ASLR and other memory protection mechanisms

echo 2 > /proc/sys/kernel/randomize_va_space
Enable DEP/NX bit if available

🧯 If You Can't Patch

  • Network segmentation: Isolate devices running vulnerable JerryScript versions
  • Implement strict input validation and sandboxing for JavaScript execution

🔍 How to Verify

Check if Vulnerable:

Check JerryScript version: jerry --version should show 2.3.0 if vulnerable

Check Version:

jerry --version

Verify Fix Applied:

Verify jerry --version shows 2.4.0 or later

📡 Detection & Monitoring

Log Indicators:

  • Segmentation fault logs
  • Memory access violation errors
  • JerryScript crash reports

Network Indicators:

  • Unexpected traffic from JerryScript devices
  • Anomalous memory-related network patterns

SIEM Query:

source="*jerry*" AND ("segmentation fault" OR "out of bounds" OR "memory violation")

🔗 References

📤 Share & Export