Cloudanix VulnDB

CVE-2022-22888

High · 7.8

CVSS

7.8

EPSS

0.7%

Published

Jan 20, 2022

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A flaw in a lightweight JavaScript engine used in small devices can let an attacker who supplies bad code crash the device or take control of it.

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

Stack overflow triggered in ecma_op_object_find_own during object property lookup, resulting in memory corruption within the JerryScript engine.

Why it matters to the business

Applications or devices using the affected JavaScript engine may crash or allow code execution when processing untrusted scripts, disrupting embedded and IoT deployments with no vendor-supplied patch available.

How an attack unfolds

An attacker supplies a specially crafted JavaScript object that forces repeated or deep property lookups, overflowing the stack in ecma_op_object_find_own and corrupting adjacent memory to achieve code execution or denial of service.

How to fix it

Upgrade JerryScript to a version containing the corrected ecma-objects.c implementation; if no newer release exists, apply a custom patch that bounds recursion depth or replaces the vulnerable lookup routine, and rebuild all dependent firmware or applications.

How to confirm the fix worked

Confirm the running JerryScript binary version is newer than 3.0.0 and that the ecma_op_object_find_own function contains updated recursion or bounds checks; re-execute the original proof-of-concept test case to verify absence of overflow.

Typical attack path

  1. Identify a target application or device that embeds the vulnerable JerryScript version
  2. Craft malicious JavaScript containing deeply nested or specially formed object properties
  3. Deliver the script through any input channel the engine processes (file, network, or API)
  4. Trigger the object lookup path that reaches ecma_op_object_find_own
  5. Exploit the resulting stack overflow for code execution or crash

How to detect it

Review process crash logs for segmentation faults or stack overflow signals originating from the JerryScript binary; inspect any application logs that record JavaScript parsing or object construction immediately preceding the crash.

What your security team should do

  • Inventory all products and firmware that embed JerryScript and mark those at version 3.0.0 as high priority
  • Replace or rebuild affected components with a patched JerryScript build as soon as a corrected release or backport is available
  • Apply runtime sandboxing or input validation around any JavaScript execution surface until patches are deployed
  • Monitor upstream JerryScript commits for the fix and schedule regression testing

The record

Jerryscript 3.0.0 was discovered to contain a stack overflow via ecma_op_object_find_own in /ecma/operations/ecma-objects.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