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-88390 Overview
CVE-2026-88390 is an out-of-bounds write vulnerability in the jslGetTokenValueAsString() function of Espruino 2v29 (commit bffc6d0). Crafted JavaScript input containing an overlong token triggers a one-byte write beyond the JsLex.token buffer in RELEASE and NO_ASSERT builds. The out-of-bounds write corrupts the adjacent tokenValue pointer, resulting in memory corruption. Exploitation can cause application crashes or denial of service on devices running the affected Espruino JavaScript interpreter. The weakness is classified under CWE-787: Out-of-bounds Write.
Critical Impact
An attacker able to supply JavaScript input to an Espruino 2v29 interpreter can corrupt memory and crash the runtime, breaking integrity and availability of the embedded device.
Affected Products
- Espruino JavaScript interpreter version 2v29 (commit bffc6d0)
- RELEASE builds of Espruino
- NO_ASSERT builds of Espruino
Discovery Timeline
- 2026-09-24 - CVE CVE-2026-88390 published to NVD
- 2026-09-24 - Last updated in NVD database
Technical Details for CVE-2026-88390
Vulnerability Analysis
Espruino is a JavaScript interpreter designed for microcontrollers and embedded systems. The lexer component maintains a fixed-size JsLex.token buffer bounded by JSLEX_MAX_TOKEN_LENGTH for storing tokenized JavaScript identifiers and literals. When processing a token through jslGetTokenValueAsString(), the function writes a terminating null byte at offset lex->tokenl within the token buffer. If lex->tokenl equals JSLEX_MAX_TOKEN_LENGTH, that write lands one byte past the end of the buffer. The byte following the token buffer is the adjacent tokenValue pointer, which becomes corrupted by the overflow. In debug builds, an assert() catches the condition before the write, but RELEASE and NO_ASSERT builds proceed unchecked. The corrupted pointer is later dereferenced during lexer operations, producing crashes and undefined behavior on resource-constrained devices.
Root Cause
The root cause is a missing length validation combined with an off-by-one boundary condition in jslGetTokenValueAsString() in src/jslex.c. The function assumed lex->tokenl < JSLEX_MAX_TOKEN_LENGTH without enforcing it in production builds. A secondary defect in jsvGetString() in src/jsvar.c returned a length value one greater than the characters actually written, allowing lex->tokenl to reach the buffer boundary.
Attack Vector
Exploitation requires local delivery of crafted JavaScript source containing a token longer than JSLEX_MAX_TOKEN_LENGTH characters to the Espruino interpreter. No authentication or user interaction is required once the attacker can submit script input, for example over a serial console, Bluetooth Low Energy (BLE) link, or Web IDE channel exposed by the device.
// Security patch in src/jslex.c and src/jsvar.c (sanitized excerpt)
// Source: https://github.com/espruino/Espruino/commit/ecd7d43e084ba9aafa8245609347fe0f4383b38c
if (lex->tokenl==0 && lex->tokenValue) // in case we didn't store the string
lex->tokenl = (unsigned char)jsvGetString(lex->tokenValue, lex->token, JSLEX_MAX_TOKEN_LENGTH);
assert(lex->tokenl < JSLEX_MAX_TOKEN_LENGTH);
- lex->token[lex->tokenl] = 0; // add final null
if (lex->tokenl==0 && LEX_IS_RESERVED_WORD(lex->tk)) {
// src/jsvar.c - correct returned length
if (l--<=1) {
*str = 0;
jsvStringIteratorFree(&it);
- return len;
+ return len-1;
}
The patch removes the unconditional null-byte write and corrects jsvGetString() to return the actual number of characters written, preventing lex->tokenl from reaching the buffer boundary.
Detection Methods for CVE-2026-88390
Indicators of Compromise
- Unexpected crashes or resets of Espruino-based firmware shortly after receiving JavaScript input over serial, BLE, or Web IDE channels.
- Core dumps or watchdog resets referencing addresses inside the lexer code path near jslGetTokenValueAsString.
- JavaScript payloads containing identifiers or string literals exceeding typical length (hundreds of bytes in a single token).
Detection Strategies
- Inspect JavaScript inputs delivered to Espruino devices for abnormally long tokens that exceed JSLEX_MAX_TOKEN_LENGTH.
- Audit firmware builds to confirm whether NO_ASSERT or RELEASE configuration flags are enabled, which disables the protective assert().
- Correlate device reboot telemetry with recent script upload events to identify repeated crash-triggering inputs.
Monitoring Recommendations
- Collect and centralize device logs, serial output, and crash telemetry for all Espruino-based deployments.
- Monitor management interfaces (Web IDE, BLE provisioning endpoints) for unauthenticated or anomalous script submissions.
- Track firmware versions across fleets and flag any device still running Espruino 2v29 at commit bffc6d0.
How to Mitigate CVE-2026-88390
Immediate Actions Required
- Rebuild and reflash Espruino firmware from a source tree that includes commit ecd7d43e084ba9aafa8245609347fe0f4383b38c or later.
- Restrict access to interfaces that accept JavaScript input (serial, BLE, Web IDE) to trusted operators only.
- Inventory all deployed devices running Espruino 2v29 and prioritize patching those exposed to untrusted script sources.
Patch Information
The fix is published in the Espruino repository under GitHub Commit ecd7d43, which addresses GitHub Issue #2744. The patch removes the out-of-bounds null-byte write in src/jslex.c and corrects the return value of jsvGetString() in src/jsvar.c so that lex->tokenl cannot reach the buffer boundary.
Workarounds
- Build Espruino with assertions enabled (do not define NO_ASSERT) so the boundary violation is caught before the out-of-bounds write occurs.
- Reject or truncate JavaScript inputs containing tokens longer than JSLEX_MAX_TOKEN_LENGTH at an upstream gateway before forwarding to the device.
- Disable or firewall remote JavaScript upload interfaces until patched firmware is deployed.
# Rebuild Espruino from a patched source tree
git clone https://github.com/espruino/Espruino.git
cd Espruino
git checkout ecd7d43e084ba9aafa8245609347fe0f4383b38c
# Build with assertions enabled as defense in depth
make RELEASE=0
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

