CVE-2021-46339
Medium · 5.5CVSS
5.5
EPSS
0.6%
Published
Jan 20, 2022
CISA due date
—
Cloudanix analysis
A bug in the JerryScript engine lets attackers crash programs that use it by feeding in specially crafted text, stopping whatever the program was doing.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Invalid CESU-8 string input triggers an assertion failure inside ecma_new_ecma_string_from_utf8, terminating the JerryScript engine process.
Why it matters to the business
Applications embedding JerryScript become unavailable after processing a single malicious input, interrupting any service or device that depends on the engine.
How an attack unfolds
An attacker crafts a file or data stream containing a malformed CESU-8 sequence, then causes the target application to load or evaluate that data, triggering the assertion and crashing the engine.
How to fix it
Upgrade JerryScript to a version containing a corrected string-validation routine; until a patch is available, sanitize or reject untrusted input before it reaches ecma_new_ecma_string_from_utf8.
How to confirm the fix worked
Re-run the engine against the original crashing input after applying the fix and confirm the assertion no longer fires; monitor process exit codes and logs for the former failure path.
Typical attack path
- Identify an application or device that embeds JerryScript 3.0.0
- Prepare a data blob containing an invalid CESU-8 byte sequence
- Deliver the blob via local file, command-line argument, or UI interaction
- Trigger script parsing or string creation inside the engine
- Observe process termination due to the failed assertion
How to detect it
Search application and system logs for segmentation faults or abort signals originating from ecma-helpers-string.c; correlate with recent file or data ingestion events that involve JavaScript string handling.
What your security team should do
- Inventory all products and firmware that ship JerryScript 3.0.0
- Prioritize patching or replacing affected components because an exploit is already public
- Implement input sanitization layers around any JavaScript evaluation entry points
- Add crash-monitoring alerts for the ecma-helpers-string assertion pattern
The record
There is an Assertion 'lit_is_valid_cesu8_string (string_p, string_size)' failed at /base/ecma-helpers-string.c(ecma_new_ecma_string_from_utf8) in JerryScript 3.0.0.
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