CVE-2021-41752
Critical · 9.8CVSS
9.8
EPSS
1.2%
Published
Apr 5, 2022
CISA due date
—
Cloudanix analysis
A flaw in a JavaScript engine used inside many small devices lets attackers remotely take control or shut them down by sending specially crafted code.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Library
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Unbounded recursive calls to the new opt() function trigger a stack overflow, resulting in memory corruption that can lead to arbitrary code execution or denial of service.
Why it matters to the business
Remote attackers can fully compromise or crash embedded and IoT devices running vulnerable Jerryscript, disrupting operations and potentially allowing persistent access in widely deployed environments.
How an attack unfolds
An attacker supplies crafted JavaScript input that forces repeated recursive invocations of the opt() function, overflowing the call stack and corrupting memory to achieve code execution; public exploits are available.
How to fix it
Upgrade Jerryscript to commit e1ce7dd7271288be8c0c8136eea9107df73a8ce2 or newer; rebuild and redeploy all affected applications and firmware images.
How to confirm the fix worked
Confirm the source tree contains commit e1ce7dd7271288be8c0c8136eea9107df73a8ce2; re-test previously crashing inputs to verify recursion depth is now bounded.
Typical attack path
- Deliver malicious JavaScript payload over the network to a Jerryscript instance
- Trigger unbounded recursion in the new opt() function
- Overflow the stack and corrupt adjacent memory
- Hijack control flow to execute attacker-supplied code or crash the process
How to detect it
Review application and system logs for unexpected Jerryscript process terminations or stack-related faults; examine network traffic for unusual JavaScript payloads targeting the engine.
What your security team should do
- Prioritize upgrade of all Jerryscript deployments within the next 30 days given public exploit availability
- Inventory downstream products and firmware that embed Jerryscript
- Implement network segmentation or input validation around JavaScript parsers until patches are applied
- Monitor for process crashes or high stack usage in Jerryscript binaries
The record
Stack overflow vulnerability in Jerryscript before commit e1ce7dd7271288be8c0c8136eea9107df73a8ce2 on Oct 20, 2021 due to an unbounded recursive call to the new opt() function.
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