CVE-2022-22888
High · 7.8CVSS
7.8
EPSS
0.7%
Published
Jan 20, 2022
CISA due date
—
Cloudanix analysis
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.
- 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
- Identify a target application or device that embeds the vulnerable JerryScript version
- Craft malicious JavaScript containing deeply nested or specially formed object properties
- Deliver the script through any input channel the engine processes (file, network, or API)
- Trigger the object lookup path that reaches ecma_op_object_find_own
- 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
- 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