CVE-2021-24044: Facebook Hermes type confusion via async/yield in getters/setters

CVE-2021-24044 · Severity: low · CVSS 3.1 · Published 2022-01-16

Hermes is a JavaScript engine used to power React Native applications. A type confusion vulnerability allows attackers to crash the engine or potentially execute arbitrary code by supplying specially crafted JavaScript code that misuses async and yield keywords in getter/setter functions, leading to memory safety violations.

Technologies: hermes-engine (npm). Vendors: npm.

Quick answers

Is CVE-2021-24044 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2021-24044 being exploited in the wild.
How severe is CVE-2021-24044?
Low severity, with a CVSS score of 3.1, published 16 January 2022.
Which products and versions are affected?
hermes-engine (npm) SEMVER:introduced=0,fixed=0.10.0.
Is there a fix for CVE-2021-24044?
Yes. hermes-engine (npm): upgrade to 0.10.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2021-24044 attacked?
It is attacked over the network.
Am I affected by CVE-2021-24044?
Check whether you run hermes-engine (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • hermes-engine (npm): upgrade to 0.10.0 or later
    npm install hermes-engine@0.10.0

Technical details

This vulnerability is a type confusion (CWE-843) in Hermes' handling of async/generator syntax in non-async/non-generator getter and setter functions. When invalid JavaScript code attempts to use await or yield in these contexts, Hermes incorrectly invokes generator functions without proper type validation, resulting in a segmentation fault due to memory safety violations. The attack requires no authentication and is remotely exploitable via network-delivered JavaScript code (e.g., web views, RN applications). Attackers can achieve denial of service through crash, with a low but plausible probability of remote code execution. The vulnerability is resolved in Hermes v0.10.0 and later.

Affected products

  • Facebook Hermes prior to 0.10.0

Identifiers

  • CVE-2021-24044
  • GHSA-7mhc-prgv-r3q4

Timeline

  • 2022-01-16: disclosed
  • 2022-01-16: patched: Fixed in v0.10.0

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.