Skip to main content
Vulnerability Database/CVE-2026-88389

CVE-2026-88389: Espruino NULL Pointer Dereference DOS Vulnerability

CVE-2026-88389 is a NULL pointer dereference flaw in Espruino 2v29 that allows attackers to crash the application through crafted raw string input. This post explains its technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-88389 Overview

CVE-2026-88389 is a NULL pointer dereference vulnerability [CWE-476] in Espruino 2v29 (commit bffc6d0), a JavaScript interpreter for microcontrollers. The flaw resides in the jslGetRawString() function in src/jslex.c. Crafted raw or binary string input causes the lexer to pass a NULL iterator target to jsvLockAgain(). In RELEASE and NO_ASSERT builds, the missing assertion guard allows a write through the NULL pointer. The result is memory corruption and application termination, producing a denial-of-service condition on affected devices.

Critical Impact

An attacker with local access can supply a malformed raw string that crashes the Espruino interpreter, terminating script execution and causing device-level denial of service.

Affected Products

  • Espruino 2v29 (commit bffc6d0)
  • Builds compiled with NO_ASSERT or RELEASE configuration
  • Devices and firmware images that embed the vulnerable jslex.c lexer

Discovery Timeline

  • 2026-09-25 - CVE-2026-88389 published to NVD
  • 2026-09-30 - Last updated in NVD database

Technical Details for CVE-2026-88389

Vulnerability Analysis

The defect lives in jslGetRawString() within src/jslex.c, which parses raw or binary string tokens in Espruino's JavaScript lexer. After calculating a string length, the function invokes jsvLockAgain(lex->it.var) to lock the string iterator's underlying variable. A malformed raw string, or a raw string at end-of-file, can advance the iterator past the end of the source variable. When this happens, lex->it.var becomes NULL after an earlier iterator operation frees the variable.

In debug builds, an assertion inside jsvLockAgain() catches the NULL argument. In RELEASE builds compiled with NO_ASSERT, the guard is compiled out. The function then dereferences the NULL pointer and writes to it when incrementing the reference count, which corrupts memory and crashes the interpreter.

Root Cause

The root cause is missing input validation on lex->it.var before passing it to jsvLockAgain(). The lexer assumed the iterator variable would remain valid for the duration of raw-string processing. Malformed input violates that assumption without being rejected earlier in the parse path.

Attack Vector

Exploitation requires local delivery of crafted JavaScript source containing a malformed raw or binary string literal to the Espruino interpreter. No authentication or user interaction is required beyond the ability to submit source for execution. The outcome is limited to availability loss, with no confidentiality or integrity impact.

c
     size_t stringPos = jsvStringIteratorGetIndex(&lex->it);
     lex->tokenValue = jsvNewFromStringVar(lex->sourceVar, stringPos, length);
     // skip over string
-    jsvLockAgain(lex->it.var); // jsvStringIteratorGoto assumes var was locked
-    jsvStringIteratorGoto(&lex->it, lex->sourceVar, stringPos+length);
-    jsvUnLock(lex->it.var); // jsvStringIteratorGoto assumes var was locked
+    if (lex->it.var) { // #2745 a malformed raw string (or raw str at EOF?) can push the iterator to the end and free lex->it.var
+      jsvLockAgain(lex->it.var); // jsvStringIteratorGoto assumes var was locked
+      jsvStringIteratorGoto(&lex->it, lex->sourceVar, stringPos+length);
+      jsvUnLock(lex->it.var); // jsvStringIteratorGoto assumes var was locked
+    }
   } else {
     /* if it will fit in a single string, allocate one and fill it up! */
     lex->tokenValue = jsvNewWithFlags(JSV_STRING_0 + length);

Source: GitHub Commit 0db0663. The patch adds a NULL check on lex->it.var before the lock/goto/unlock sequence.

Detection Methods for CVE-2026-88389

Indicators of Compromise

  • Unexpected Espruino interpreter crashes or watchdog resets when processing user-supplied scripts
  • Core dumps or fault logs referencing jslGetRawString or jsvLockAgain in the call stack
  • Scripts containing malformed raw or binary string literals submitted via REPL, serial, or Bluetooth interfaces

Detection Strategies

  • Audit firmware builds to identify Espruino 2v29 with commit bffc6d0 or earlier compiled with NO_ASSERT
  • Fuzz the lexer with malformed raw-string inputs to reproduce the fault in a controlled environment
  • Review script-submission channels for anomalous input patterns that terminate interpreter sessions

Monitoring Recommendations

  • Log and alert on Espruino process restarts and abnormal exits on managed IoT devices
  • Capture serial and Bluetooth console output for assertion failures or segmentation faults
  • Track inbound script sources and correlate crashes with specific submitters or payloads

How to Mitigate CVE-2026-88389

Immediate Actions Required

  • Apply upstream commit 0db0663ac5201a6fea68094b45da673edec45187 to the Espruino source tree and rebuild firmware
  • Restrict access to script-submission interfaces (serial, Bluetooth, Web IDE) to trusted users only
  • Enable assertions in builds where device resources permit, so the fault aborts safely rather than corrupting memory

Patch Information

The fix is published in Espruino commit 0db0663, which resolves GitHub Issue #2745. The patch wraps the jsvLockAgain / jsvStringIteratorGoto / jsvUnLock sequence in a if (lex->it.var) guard, preventing the NULL dereference when a malformed raw string frees the iterator variable.

Workarounds

  • Avoid executing untrusted JavaScript on vulnerable Espruino builds until firmware is updated
  • Validate or strip raw and binary string literals in scripts before passing them to the interpreter
  • Compile Espruino with assertions enabled to convert the write-through-NULL into a controlled abort
bash
# Apply the upstream fix and rebuild Espruino firmware
git clone https://github.com/espruino/Espruino.git
cd Espruino
git cherry-pick 0db0663ac5201a6fea68094b45da673edec45187
make clean && make

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.