CVE-2021-46348
Medium · 5.5CVSS
5.5
EPSS
0.6%
Published
Jan 20, 2022
CISA due date
—
Cloudanix analysis
A bug in a small JavaScript engine used inside other programs lets an attacker crash those programs by giving them specially crafted code to run.
- 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
The vulnerability triggers an assertion failure 'ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)' in the ECMA literal storage module of the JerryScript engine, causing an immediate process abort and denial of service.
Why it matters to the business
Applications or devices embedding the vulnerable JerryScript engine can be crashed on demand, interrupting services, automation workflows, or embedded JavaScript execution with no data integrity impact but clear availability loss.
How an attack unfolds
An attacker supplies a crafted JavaScript payload that reaches the literal storage path with an unexpected reference count; when JerryScript processes the input the failing assertion aborts the engine. Public exploit code exists and the issue has been known for years.
How to fix it
Upgrade JerryScript to a patched release that removes or guards the assertion in ecma-literal-storage.c; where an upgrade path is unavailable, isolate or sandbox the engine and reject untrusted JavaScript inputs.
How to confirm the fix worked
Reproduce the original crashing input in a controlled environment and confirm the process no longer aborts; inspect binaries or source for the presence of the literal-storage assertion and verify updated builds pass regression tests.
Typical attack path
- Locate a target process or device that embeds the vulnerable JerryScript version
- Craft or obtain a minimal JavaScript input that violates the single-reference assumption in literal storage
- Deliver the input through any interface the application uses to ingest JavaScript (file, network, API)
- Trigger execution or parsing so the assertion is evaluated and the process terminates
How to detect it
Search application and system logs for abrupt terminations accompanied by the literal-storage assertion message or core dumps originating from jerry-core/ecma/base/ecma-literal-storage.c.
What your security team should do
- Inventory all deployments that embed JerryScript 3.0.0 or earlier
- Apply the latest JerryScript release or back-port the literal-storage fix
- Add runtime sandboxing and input-size limits around JavaScript execution
- Configure process monitoring to alert on unexpected JerryScript terminations
The record
There is an Assertion 'ECMA_STRING_IS_REF_EQUALS_TO_ONE (string_p)' failed at /jerry-core/ecma/base/ecma-literal-storage.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