CVE-2022-22895
High · 7.8CVSS
7.8
EPSS
0.8%
Published
Jan 21, 2022
CISA due date
—
Cloudanix analysis
A bug in a lightweight JavaScript engine can let attackers crash or take control of devices and apps that use it simply by supplying specially crafted text.
- 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
Heap buffer overflow in ecma_utf8_string_to_number_by_radix during UTF-8 string to numeric conversion by radix, enabling out-of-bounds read/write on the heap.
Why it matters to the business
Embedded JavaScript engines in IoT, edge, or scripting applications may experience crashes or remote code execution when processing attacker-controlled input, leading to service outages or device compromise; the issue remains unpatched in listed releases with public exploit code available for over four years.
How an attack unfolds
An attacker supplies a crafted string input that reaches the vulnerable conversion routine; the malformed radix handling triggers an oversized write beyond the allocated heap buffer, allowing memory corruption that can be leveraged for arbitrary code execution given the available public exploit.
How to fix it
Upgrade to the latest JerryScript release that resolves the buffer handling flaw in ecma_utf8_string_to_number_by_radix; if no fixed release is published, apply custom patches to bounds-check the conversion buffer or disable the affected radix conversion path.
How to confirm the fix worked
Rebuild with address sanitizer or similar instrumentation and re-test the conversion function using inputs that previously triggered the overflow; confirm absence of crashes or sanitizer reports on boundary cases.
Typical attack path
- Identify an application embedding the affected JerryScript version
- Craft a malicious UTF-8 string designed to overflow the radix conversion buffer
- Deliver the input through normal application channels that invoke ecma-helpers-conversion
- Trigger heap corruption and execute attacker-controlled code or cause denial of service
How to detect it
Inspect process crash dumps or sanitizer logs for heap-buffer-overflow signatures originating from ecma-helpers-conversion.c; correlate application logs showing unexpected numeric conversion failures or memory exhaustion events around string handling.
What your security team should do
- Prioritize inventory of all JerryScript deployments given the public exploit and long disclosure window
- Apply upstream patches or backported bounds checks immediately
- Restrict untrusted input to string-to-number conversion surfaces until fixed
- Monitor vendor advisories for a future fixed release
The record
Jerryscript 3.0.0 was discovered to contain a heap-buffer-overflow via ecma_utf8_string_to_number_by_radix in /jerry-core/ecma/base/ecma-helpers-conversion.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