CVE-2021-26195

8.8 HIGH

📋 TL;DR

CVE-2021-26195 is a heap buffer overflow vulnerability in JerryScript's number parsing function that allows attackers to execute arbitrary code or cause denial of service. This affects applications using JerryScript 2.4.0 for JavaScript execution, particularly IoT devices and embedded systems. Attackers can exploit this by providing malicious JavaScript input to vulnerable systems.

💻 Affected Systems

Products:
  • JerryScript
Versions: 2.4.0
Operating Systems: All platforms running JerryScript
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using JerryScript 2.4.0 to parse JavaScript is vulnerable by default

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or device takeover

🟠

Likely Case

Denial of service causing application crashes and service disruption

🟢

If Mitigated

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

🌐 Internet-Facing: HIGH - Exploitable remotely via JavaScript input to exposed services
🏢 Internal Only: MEDIUM - Requires attacker to have access to internal systems or supply malicious JavaScript

🎯 Exploit Status

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

Proof of concept available in GitHub issues; exploitation requires ability to supply JavaScript input to vulnerable parser

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.4.1 and later

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

Restart Required: Yes

Instructions:

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

🔧 Temporary Workarounds

Input Validation

all

Implement strict input validation to reject malformed JavaScript before it reaches the parser

Memory Protection

linux

Enable ASLR and DEP/PaX to make exploitation more difficult

echo 2 > /proc/sys/kernel/randomize_va_space

🧯 If You Can't Patch

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

🔍 How to Verify

Check if Vulnerable:

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

Check Version:

jerry --version

Verify Fix Applied:

Verify version is 2.4.1 or later: jerry --version

📡 Detection & Monitoring

Log Indicators:

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

Network Indicators:

  • Unusual JavaScript payloads in network traffic
  • Repeated connection attempts to JerryScript services

SIEM Query:

process_name:"jerry" AND (event_type:"crash" OR exit_code:139)

🔗 References

📤 Share & Export