CVE-2025-65570
Executive Summary
CVE-2025-65570 is a type confusion vulnerability in Jsish 2.0, a JavaScript interpreter. The flaw occurs during the execution of the OP_NEXT opcode when an instanceof expression uses an array element access as the left-hand operand inside a for-in loop. The instruction implementation leaves an additional array reference on the stack rather than consuming it during OP_INSTANCEOF. Consequently, OP_NEXT interprets the array as an iterator object and reads the iterCmd function pointer from an invalid structure, potentially causing a crash or enabling code execution depending on heap layout. No public exploit or patch is currently available.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
Jsish is a standalone JavaScript interpreter, not distributed via NPM, PyPI, Go, or Ruby registries. However, it may be bundled in custom applications or embedded systems. Users should verify if Jsish is included in their software supply chain and assess the risk accordingly.
CVSS Breakdown & Threat Level
The CVSS score is 0.0, indicating no official assessment has been published. Based on the technical description, the vulnerability could lead to:
- Confidentiality Impact: High (potential code execution)
- Integrity Impact: High (potential code execution)
- Availability Impact: High (potential crash)
- Attack Vector: Local (requires user interaction to run malicious script)
- Attack Complexity: High (requires specific heap layout)
- Privileges Required: None
- User Interaction: Required (victim must execute crafted script)
- Scope: Unchanged
Threat Level: High (if exploitable for code execution)
Deep Dive & Mechanics
The vulnerability resides in the Jsish bytecode interpreter, specifically in the handling of OP_NEXT and OP_INSTANCEOF opcodes. When a for-in loop iterates over an array and an instanceof check is performed on an array element access, the interpreter fails to properly manage the stack.
Normal Flow:
OP_INSTANCEOFconsumes two operands (object and constructor) and pushes a boolean.OP_NEXTexpects an iterator object on the stack to advance the loop.
Vulnerable Flow:
- The
instanceofexpression uses an array element access (e.g.,arr[i] instanceof Array). - The interpreter leaves an extra array reference on the stack after
OP_INSTANCEOF. OP_NEXTthen reads this array reference as if it were an iterator object.- The array's structure is misinterpreted, and the
iterCmdfunction pointer is read from an invalid offset. - This can lead to a crash or, with careful heap manipulation, arbitrary code execution.
Root Cause: Incorrect stack management in the bytecode compiler or interpreter for the combination of for-in loops and instanceof with array element access.
Vulnerable vs. Patched Code
No patched version is available. The vulnerable code is in the Jsish interpreter's opcode handlers. A hypothetical patch would involve:
Vulnerable (pseudo-code):
void op_instanceof() {
// Pops two values, pushes boolean
// BUT: does not clean up extra array reference
push(boolean_result);
}
void op_next() {
// Expects iterator on stack
// Reads iterCmd from the object
// If object is actually an array, reads from wrong offset
iter = pop();
iter->iterCmd(...);
}
Patched (hypothetical):
void op_instanceof() {
// Ensure only two values are consumed
// Clean up any extra references
push(boolean_result);
// Additional cleanup if needed
}
void op_next() {
// Validate that the object is a valid iterator
iter = pop();
if (iter->type != ITERATOR_TYPE) {
// Handle error
}
iter->iterCmd(...);
}
Exploitation & Lab Setup
Red Team
Prerequisites:
- Jsish 2.0 interpreter
- Ability to execute a crafted JavaScript file
Exploit Concept:
- Craft a JavaScript file that triggers the type confusion.
- Manipulate heap layout to control the
iterCmdfunction pointer. - Redirect execution to a shellcode or ROP chain.
Example Trigger Script:
// trigger.js
var arr = [1, 2, 3];
for (var i in arr) {
// This line triggers the type confusion
if (arr[i] instanceof Array) {
// Code execution may occur here
}
}
Note: No public exploit exists. The above is a conceptual trigger.
Blue Team
Detection:
- Monitor for unusual crashes in Jsish processes.
- Look for scripts containing
for-inloops withinstanceofchecks on array elements. - Use behavioral analysis to detect abnormal memory access patterns.
Hunting:
- Search for Jsish version 2.0 in your environment.
- Review logs for segmentation faults or access violations related to Jsish.
Indicators of Compromise (IOCs)
- File Hashes: None available (no known exploit samples)
- Network Indicators: None (local vulnerability)
- Process Behavior: Jsish process crash with SIGSEGV or similar
- Log Entries: Segmentation fault in Jsish interpreter at opcode handler
Detection Engineering
YARA Rule
rule CVE_2025_65570_Jsish_Type_Confusion {
meta:
description = "Detects Jsish scripts exploiting CVE-2025-65570"
author = "Valters IT"
date = "2025-01-01"
reference = "CVE-2025-65570"
strings:
$s1 = "for (var " ascii
$s2 = " in " ascii
$s3 = "instanceof" ascii
$s4 = "[" ascii
$s5 = "]" ascii
condition:
all of ($s1, $s2, $s3) and 1 of ($s4, $s5)
}
Sigma Rule
title: Jsish Type Confusion Exploit Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects potential exploitation of CVE-2025-65570 in Jsish
author: Valters IT
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/jsish'
CommandLine|contains: 'instanceof'
condition: selection
falsepositives:
- Legitimate use of instanceof in Jsish scripts
level: high
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2025-65570 Jsish Type Confusion Attempt"; flow:to_server,established; content:"instanceof"; content:"for"; content:"in"; within:100; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate: Remove or restrict access to Jsish 2.0 in production environments.
- Monitor: Watch for crashes or unusual behavior in Jsish processes.
- Update: No patch available; consider switching to an alternative JavaScript interpreter (e.g., Duktape, QuickJS).
Long-term:
- Apply memory safety mitigations (ASLR, DEP, stack canaries) to reduce exploitability.
- Implement input validation and sandboxing for Jsish scripts.
- Monitor for official patches from the Jsish project.
Workaround:
- Avoid using
for-inloops withinstanceofchecks on array elements in Jsish scripts.
Valters IT
DevSecOps & Cyber Threat Intelligence
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.