CVE-2021-46342
Medium · 5.5CVSS
5.5
EPSS
0.6%
Published
Jan 20, 2022
CISA due date
—
Cloudanix analysis
A bug in a JavaScript engine can make programs using it crash when they receive certain unusual input, causing temporary service interruptions.
- 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
Failed assertion in ecma-helpers.c triggers a crash when processing certain JavaScript objects that violate expected lexical environment or fast-array invariants.
Why it matters to the business
Local denial-of-service that can interrupt any application or service relying on the affected JavaScript engine, with low likelihood of data loss but potential for repeated service restarts.
How an attack unfolds
An attacker supplies a specially crafted JavaScript snippet or object literal that reaches the assertion check inside the ECMA helper routines; the assertion fails and the process terminates. Public exploit code exists but requires local execution or user interaction to load the malicious script.
How to fix it
No fixed versions are listed; apply vendor or community patches if later released, or rebuild with the assertion converted to a graceful error return. Restrict untrusted script execution and validate input objects before passing them to the engine.
How to confirm the fix worked
Reproduce the original assertion failure with the known triggering script; confirm the process no longer crashes or that the assertion is removed after applying any patch or workaround.
Typical attack path
- Identify an application or service that embeds JerryScript and accepts untrusted JavaScript input.
- Craft a minimal JavaScript payload that violates the lexical-environment or fast-array assumption.
- Deliver the payload via local file, command-line argument, or UI-triggered script load.
- Trigger script execution to reach the failing assertion and crash the process.
How to detect it
Review application or system logs for segmentation faults, abort signals, or the exact assertion string from ecma-helpers.c around the time of unexpected process exits. Correlate with recent file or script loads if user interaction is required.
What your security team should do
- Treat as local DoS and prioritize only if the engine runs untrusted scripts from users.
- Disable or sandbox JerryScript usage where possible until a fix appears.
- Monitor for new upstream releases and test them promptly.
- Add runtime monitoring for unexpected process terminations in services using the engine.
The record
There is an Assertion 'ecma_is_lexical_environment (obj_p) || !ecma_op_object_is_fast_array (obj_p)' failed at /jerry-core/ecma/base/ecma-helpers.c 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