CVE-2021-46343
Medium · 5.5CVSS
5.5
EPSS
0.6%
Published
Jan 20, 2022
CISA due date
—
Cloudanix analysis
A problem in a JavaScript engine can make programs using it crash when they receive certain bad code, interrupting whatever service relies on that engine.
- 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 'context_p->token.type == LEXER_LITERAL' in the JavaScript expression parser at js-parser-expr.c, causing the JerryScript engine to abort when processing certain inputs.
Why it matters to the business
Applications or embedded systems using JerryScript may crash when handling untrusted or malformed JavaScript, resulting in denial of service and operational downtime.
How an attack unfolds
An attacker supplies a specially crafted JavaScript snippet that violates the parser's token type assumption during expression parsing; when the victim application processes the input locally with user interaction, the assertion fails and the process terminates.
How to fix it
Upgrade JerryScript to a version that resolves the parser assertion issue once released; in the interim, avoid processing untrusted JavaScript, implement strict input sanitization, and run the engine under resource limits or sandboxing.
How to confirm the fix worked
Confirm JerryScript version is updated, then test parsing of known assertion-triggering inputs in a controlled environment to verify absence of crashes and assertion failures.
Typical attack path
- Create malicious JavaScript input designed to fail the lexer literal token check in the expression parser.
- Deliver the input file or payload to a target system running an affected JerryScript version.
- Trigger local parsing of the input via the affected application to induce the assertion failure and crash.
How to detect it
Review application and system logs for assertion failure messages referencing js-parser-expr.c or LEXER_LITERAL, unexpected process terminations of jerryscript binaries, or crash dumps containing parser expression context.
- Assertion 'context_p->token.type == LEXER_LITERAL' failed at /jerry-core/parser/js/js-parser-expr.c
- jerry-core/parser/js/js-parser-expr.c
What your security team should do
- Inventory all deployments of JerryScript and assess exposure to untrusted inputs.
- Prioritize upgrades as soon as fixed versions become available.
- Apply compensating controls such as input validation and process isolation until patched.
- Monitor project releases and security advisories for JerryScript updates.
The record
There is an Assertion 'context_p->token.type == LEXER_LITERAL' failed at /jerry-core/parser/js/js-parser-expr.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