Cloudanix VulnDB

CVE-2022-22893

High · 7.8

CVSS

7.8

EPSS

0.7%

Published

Jan 21, 2022

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

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.

Exploit Available
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

  1. Locate an application or test harness that invokes Jerryscript 3.0.0
  2. Craft a JavaScript file containing the triggering bytecode pattern
  3. Supply the file as local input or command-line argument
  4. 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