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-88388 Overview
CVE-2026-88388 is a stack-based buffer overflow [CWE-121] in Espruino 2v29 (commit bffc6d0) affecting 64-bit builds. The flaw sits in the JavaScript error stack-trace handling path. When an exception reaches jslPrintTokenLineMarker(), the function passes the address of a 4-byte int column variable to jsvGetLineAndCol() as a size_t pointer. jsvGetLineAndCol() then performs an 8-byte write through the mismatched pointer, overwriting adjacent stack memory. A remote attacker can trigger the overflow by supplying JavaScript input that raises an exception, enabling denial-of-service conditions on the interpreter process.
Critical Impact
Remote attackers can corrupt stack memory in Espruino 2v29 by submitting crafted JavaScript that triggers an exception, resulting in process crashes and loss of availability on affected 64-bit devices.
Affected Products
- Espruino JavaScript interpreter version 2v29
- Builds derived from commit bffc6d0
- 64-bit platform builds of Espruino
Discovery Timeline
- 2026-09-24 - CVE-2026-88388 published to NVD
- 2026-09-25 - Last updated in NVD database
Technical Details for CVE-2026-88388
Vulnerability Analysis
The vulnerability resides in Espruino's lexer and variable handling code. When the JavaScript runtime encounters an exception, control flows into jslPrintTokenLineMarker() to produce a formatted stack trace. That function declares a local int col variable to receive the current column number and passes &col to jsvGetLineAndCol(). On 64-bit builds, the callee treats the pointer as size_t* and writes eight bytes into a four-byte stack slot. The extra four bytes overwrite adjacent stack content, including potentially saved registers or return addresses depending on the compiler-selected stack layout.
Root Cause
The root cause is a pointer type mismatch between caller and callee. The caller uses int (4 bytes on 64-bit systems), while the callee dereferences the pointer as size_t (8 bytes on 64-bit systems). This mismatch violates the type contract between the two functions and produces an out-of-bounds write on the stack, classified as a stack-based buffer overflow [CWE-121].
Attack Vector
Exploitation requires the attacker to supply JavaScript input that is parsed and executed by the Espruino interpreter and that triggers an exception reaching the stack-trace printer. No authentication or user interaction is required. The attack is reachable over the network wherever Espruino accepts remote JavaScript input, for example via exposed REPL interfaces or web-connected device endpoints.
// Patch excerpt from src/jslex.c
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)) {
// pretokenised - so we'll work out the name from our token name list
// this isn't fast, but won't be called very often
// Patch excerpt from src/jsvar.c
if (l--<=1) {
*str = 0;
jsvStringIteratorFree(&it);
- return len;
+ return len-1;
}
*(str++) = jsvStringIteratorGetChar(&it);
jsvStringIteratorNext(&it);
// Source: https://github.com/espruino/Espruino/commit/ecd7d43e084ba9aafa8245609347fe0f4383b38c
Detection Methods for CVE-2026-88388
Indicators of Compromise
- Unexpected crashes or restarts of Espruino interpreter processes shortly after receiving JavaScript input
- Core dumps showing stack corruption near jslPrintTokenLineMarker or jsvGetLineAndCol frames
- Repeated submission of JavaScript payloads designed to raise exceptions from untrusted sources
Detection Strategies
- Instrument Espruino builds with AddressSanitizer (ASan) during testing to flag the 8-byte write to the 4-byte stack slot
- Monitor device logs for abnormal termination events correlated with inbound script submissions
- Inspect network traffic to Espruino endpoints for JavaScript payloads containing malformed syntax or guaranteed exception triggers
Monitoring Recommendations
- Collect telemetry on process restarts and crash signals from IoT fleets running Espruino
- Alert on repeated connection sources that cause interpreter crashes within short windows
- Track deployed firmware versions and highlight hosts still running the vulnerable bffc6d0 build
How to Mitigate CVE-2026-88388
Immediate Actions Required
- Rebuild Espruino from a commit that includes the fixes referenced in the upstream patch
- Restrict network exposure of Espruino REPL and script submission interfaces to trusted networks
- Disable remote JavaScript execution paths on production devices where feasible until patched
Patch Information
Upstream fixes are available in the Espruino repository. See the Espruino GitHub commit ecd7d43 for the corrective changes to src/jslex.c and src/jsvar.c. Rebuild firmware images from the patched source and redeploy to affected devices.
Workarounds
- Place Espruino devices behind network segmentation that blocks untrusted script submission
- Require authenticated transport (such as TLS with client certificates) in front of any JavaScript interface
- Rate-limit incoming script requests and drop clients that repeatedly trigger interpreter faults
# Example: rebuild Espruino from patched sources
git clone https://github.com/espruino/Espruino.git
cd Espruino
git checkout ecd7d43e084ba9aafa8245609347fe0f4383b38c
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

