CVE-2021-46338
Medium · 5.5CVSS
5.5
EPSS
0.7%
Published
Jan 20, 2022
CISA due date
—
Cloudanix analysis
A bug in a JavaScript engine can make programs using it suddenly stop working when they receive certain bad input.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
An assertion failure in ecma_get_lex_env_type at ecma-helpers.c causes the process to abort when processing certain lexical environment objects.
Why it matters to the business
Applications or services using the affected engine can be forced to crash, interrupting availability and requiring restarts.
How an attack unfolds
An attacker crafts input that reaches an invalid lexical environment object; when the engine evaluates it, the assertion triggers and the process terminates. No remote code execution or data access occurs.
How to fix it
Upgrade chakra-core/chakracore and microsoft/chakracore to commit d797e3f00e34c12c8c0ae52f56344325439dccd7 or later; rebuild and redeploy all dependent binaries.
How to confirm the fix worked
Confirm the installed binary or source tree contains commit d797e3f00e34c12c8c0ae52f56344325439dccd7; re-run any available regression tests covering ecma-helpers.c.
Typical attack path
- Identify a ChakraCore-based application that accepts untrusted scripts or data
- Prepare a minimal input that violates the lexical environment assumption
- Deliver the input locally with user interaction (e.g., file open or script load)
- Trigger evaluation path that calls ecma_get_lex_env_type
- Observe process termination and service outage
How to detect it
Review application or system logs for abrupt terminations or assertion messages containing ecma_get_lex_env_type or ecma-helpers.c around the time of reported outages.
What your security team should do
- Immediately update all ChakraCore instances to the fixed commit
- Scan build pipelines and package repositories for older snapshots
- Add the fixed commit hash to dependency allow-lists and SBOM checks
- Monitor for any downstream dependents that still ship vulnerable builds
The record
There is an Assertion 'ecma_is_lexical_environment (object_p)' failed at /base/ecma-helpers.c(ecma_get_lex_env_type) 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