CVE-2020-1912: Out-of-bounds Read and Out-of-bounds Write in Facebook Hermes
8.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.81186%
CWE
Published
5/24/2022
Updated
1/27/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
hermes-engine | npm | <= 0.4.3 | 0.5.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper handling of generator inner functions during lazy compilation. The commit adds 'isGeneratorInnerFunction' tracking through LazySource/LazyCompilationData
structures. The vulnerable functions are those responsible for: 1) Generating ES5 functions (genES5Function
) without properly setting the generator inner function flag, leading to incorrect scope chain resolution. 2) Lazy function restoration (doLazyFunction
) that didn't account for generator context. These omissions would cause memory access miscalculations when resolving variables in nested generator functions, enabling OOB read/write through crafted JavaScript.