CVE-2022-22893
High · 7.8CVSS
7.8
EPSS
0.7%
Published
Jan 21, 2022
CISA due date
—
Cloudanix analysis
A flaw in an older version of a JavaScript engine lets someone who can run their own code on the same computer crash programs or take control of the machine.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
A stack overflow in vm_loop.lto_priv.304 within /jerry-core/vm/vm.c allows an attacker-supplied script to corrupt the call stack during bytecode execution, enabling control-flow hijacking or denial of service.
Why it matters to the business
Applications embedding the vulnerable Jerryscript engine can be crashed or compromised by locally supplied malicious scripts, resulting in service outages or unauthorized code execution on developer or embedded systems.
How an attack unfolds
An attacker creates a JavaScript payload that triggers excessive recursion or malformed bytecode in the vm_loop function; when the script is executed by Jerryscript 3.0.0 the stack overflows, allowing the attacker to overwrite return addresses and gain arbitrary code execution.
How to fix it
Upgrade Jerryscript to the latest available release that resolves the vm_loop stack overflow; rebuild and redeploy all dependent binaries. Where upgrades are not immediately possible, sandbox script execution and disable untrusted script loading.
How to confirm the fix worked
Confirm the installed Jerryscript version is newer than 3.0.0, recompile with the fix, and execute known triggering test cases to verify the vm_loop function no longer overflows.
Typical attack path
- Locate an application or test harness that invokes Jerryscript 3.0.0
- Craft a JavaScript file containing the triggering bytecode pattern
- Supply the file as local input or command-line argument
- Execute the script to trigger the stack overflow and achieve code execution
How to detect it
Review application crash logs and core dumps for references to vm_loop or vm.c; correlate with process execution of jerry or jerryscript binaries and look for unusually deep call stacks or segmentation faults during script interpretation.
What your security team should do
- Immediately replace Jerryscript 3.0.0 with a patched build across all products
- Restrict execution of untrusted JavaScript in any Jerryscript-based component
- Add the affected vm.c function to static-analysis and fuzzing pipelines
The record
Jerryscript 3.0.0 was discovered to contain a stack overflow via vm_loop.lto_priv.304 in /jerry-core/vm/vm.c.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Ubuntu:18.04:LTS | iotjs | 0 | No fix |
| Ubuntu:22.04:LTS | iotjs | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | iotjs | 0 | No fix |
| conan | jerryscript | 3.0.0 | No fix |
Related vulnerabilities
- CVE-2024-33255 Jerryscript commit cefd391 was discovered to contain an Assertion Failure via… Also affects iotjs
- CVE-2024-33260 Jerryscript commit cefd391 was discovered to contain a segmentation violation via the… Also affects iotjs
- CVE-2024-33258 Jerryscript commit ff9ff8f was discovered to contain a segmentation violation via the… Also affects iotjs
- CVE-2024-33259 Jerryscript commit cefd391 was discovered to contain a segmentation violation via the… Also affects iotjs
- CVE-2023-36109 Buffer Overflow vulnerability in JerryScript version 3.0, allows remote attackers to… Also affects iotjs
- CVE-2023-38961 Buffer Overflwo vulnerability in JerryScript Project jerryscript v.3.0.0 allows a remote… Also affects iotjs
- CVE-2023-36201 An issue in JerryscriptProject jerryscript v.3.0.0 allows an attacker to obtain sensitive… Also affects iotjs
- CVE-2023-34867 Jerryscript 3.0 (commit 05dbbd1) was discovered to contain an Assertion Failure via the… Also affects iotjs