Cloudanix VulnDB

CVE-2021-42863

Critical · 9.8

CVSS

9.8

EPSS

1.7%

Published

May 12, 2022

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

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.

Exploit Available
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

  1. Identify a target application or device embedding the vulnerable JerryScript engine
  2. Craft malicious JavaScript input targeting the TypedArray filter prototype function
  3. Trigger the buffer overflow to create fake objects or unlimited ArrayBuffers
  4. 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