CVE-2021-42863
Critical · 9.8CVSS
9.8
EPSS
1.7%
Published
May 12, 2022
CISA due date
—
Cloudanix analysis
A flaw in a JavaScript engine used by many devices lets attackers run harmful code remotely by sending bad data, potentially taking over the device.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Remote Code Execution
- Component
- Library
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Buffer overflow in ecma_builtin_typedarray_prototype_filter allows construction of fake objects or ArrayBuffers with unlimited size, enabling memory corruption and potential arbitrary code execution.
Why it matters to the business
Attackers can remotely compromise devices or applications using this JavaScript engine, leading to data theft, device takeover, or service disruption in embedded and IoT environments.
How an attack unfolds
An attacker supplies specially crafted JavaScript that invokes the filter method on a TypedArray, triggering the overflow to overwrite memory structures and instantiate fake objects or unbounded ArrayBuffers for further exploitation such as code injection.
How to fix it
Upgrade to a patched JerryScript build that resolves the buffer overflow in ecma_builtin_typedarray_prototype_filter; monitor project commits for the fix and rebuild all dependent applications and firmware images.
How to confirm the fix worked
Review source history for commits addressing the filter function, perform memory-safety testing on TypedArray operations, and confirm absence of the vulnerable code path via static analysis or fuzzing.
Typical attack path
- Identify a target application or device embedding the vulnerable JerryScript engine
- Craft malicious JavaScript input targeting the TypedArray filter prototype function
- Trigger the buffer overflow to create fake objects or unlimited ArrayBuffers
- Leverage corrupted memory to achieve arbitrary code execution or data exfiltration
How to detect it
Search application and system logs for crashes or unusual memory allocations during TypedArray filter operations; inspect JavaScript execution traces for malformed inputs targeting prototype methods.
- ecma_builtin_typedarray_prototype_filter
- jerryscript fe3a5c0
What your security team should do
- Prioritize inventory of all JerryScript deployments given the critical severity and available exploit
- Apply updates or backports immediately where available and test in isolated environments
- Implement input validation and sandboxing around JavaScript execution contexts
- Monitor upstream JerryScript repository for official remediation
The record
A buffer overflow in ecma_builtin_typedarray_prototype_filter() in JerryScript version fe3a5c0 allows an attacker to construct a fake object or a fake arraybuffer with unlimited size.
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 |
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