Quick answers
- Is CVE-2021-24037 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2021-24037 being exploited in the wild.
- How severe is CVE-2021-24037?
- Low severity, with a CVSS score of 3.1, published 24 May 2022.
- Which products and versions are affected?
- Meta Hermes <=0.7.2; hermes-engine (npm) SEMVER:introduced=0,fixed=0.8.0.
- Is there a fix for CVE-2021-24037?
- Yes. hermes-engine (npm): upgrade to 0.8.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2021-24037 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2021-24037?
- Check whether you run Meta Hermes or 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.8.0 or later
npm install hermes-engine@0.8.0
Technical details
This is a use-after-free vulnerability (CWE-416) in the Hermes JavaScript engine occurring in the error message emission path, specifically in the `transientObjectPutErrorMessage` function. The root cause is that a UTF16Ref returned from `StringView::getUTF16Ref` can be invalidated when more content is appended to the allocator, but the invalidated pointer is still used, resulting in access to freed memory. An attacker can trigger this by crafting malicious JavaScript that causes specific error messages to be emitted. The vulnerability is only exploitable if the host application permits evaluation of untrusted JavaScript; applications that only execute trusted/bundled code are not affected. Successful exploitation allows arbitrary code execution with the privileges of the application. The vulnerability was fixed in Hermes version 0.8.0 (commit d86e185e485b6330216dee8e854455c694e3a36e).
Affected products
- Meta Hermes <=0.7.2
Identifiers
- CVE-2021-24037
- GHSA-mph8-6787-r8hw
Timeline
- 2021-06-15: disclosed
- 2022-05-24: advisory
- 2022-05-24: patched: Fixed in version 0.8.0