CVE-2021-24037 Use After Free in Hermes
Attackers can execute arbitrary code via crafted JavaScript in Hermes if the application permits untrusted script evaluation.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-24037?
CVE-2021-24037 is a critical use after free vulnerability in Facebook Hermes, published on 15 Jun 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
A use after free in hermes, while emitting certain error messages, prior to commit d86e185e485b6330216dee8e854455c694e3a36e allows attackers to potentially execute arbitrary code via crafted JavaScript. Note that this is only exploitable if the application using Hermes permits evaluation of untrusted JavaScript. Hence, most React Native applications are not affected.
Weakness: CWE-416
Which versions are affected by CVE-2021-24037?
2 open source packages ship an affected version, including hermes-engine. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
hermes-engine npm | All versions | 0.8.0 |
hermes-engine npm | All versions | 0.8.0 |
Products include Facebook Hermes.
How do I fix CVE-2021-24037?
Upgrade hermes-engine to 0.8.0 or later.
Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.
Is CVE-2021-24037 being exploited?
There is no known exploitation of CVE-2021-24037 in the wild and no public exploit code.
Other vulnerabilities in Facebook Hermes
Sources
Also known as GHSA-mph8-6787-r8hw.