CVE-2021-41751
Critical · 9.8CVSS
9.8
EPSS
1.2%
Published
Apr 5, 2022
CISA due date
—
Cloudanix analysis
A flaw in an older version of a JavaScript engine used in many small devices lets attackers run their own code on those devices over the network if the right kind of script is processed.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Library
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Buffer overflow in ecma_builtin_array_prototype_object_slice allows out-of-bounds memory access during array operations in the JerryScript engine.
Why it matters to the business
Older JerryScript deployments face elevated risk of remote code execution or service crashes when processing untrusted JavaScript, potentially disrupting embedded or IoT applications that rely on the engine.
How an attack unfolds
An attacker supplies crafted JavaScript that invokes Array.prototype.slice with inputs triggering the vulnerable code path at line 909, causing memory corruption that can be leveraged for arbitrary code execution.
How to fix it
Update JerryScript to a build containing commit e1ce7dd7271288be8c0c8136eea9107df73a8ce2 or later; recompile and redeploy all dependent firmware or applications.
How to confirm the fix worked
Confirm the running binary or source tree includes the referenced commit; test with known triggering JavaScript inputs to verify absence of the overflow condition.
Typical attack path
- Identify a target application embedding an unpatched JerryScript engine reachable over the network.
- Deliver malicious JavaScript payload that exercises the slice function with oversized or malformed parameters.
- Trigger buffer overflow to corrupt memory and gain control of execution flow.
- Execute arbitrary code or cause denial of service on the affected device.
How to detect it
Review application or system logs for unexpected crashes or memory errors during JavaScript execution; examine process dumps for signs of corruption in array-handling routines.
What your security team should do
- Prioritize inventory of all JerryScript instances and schedule upgrades within standard change windows given the high CVSS and network exposure.
- Implement network segmentation or input sanitization around JavaScript execution contexts until patches are applied.
- Monitor EPSS and exploit maturity indicators for any future increase in observed activity.
The record
Buffer overflow vulnerability in file ecma-builtin-array-prototype.c:909 in function ecma_builtin_array_prototype_object_slice in Jerryscript before commit e1ce7dd7271288be8c0c8136eea9107df73a8ce2 on Oct 20, 2021.
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