CVE-2022-25893: vm2 vulnerable to Arbitrary Code Execution
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.32839%
CWE
Published
12/21/2022
Updated
1/30/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
vm2 | npm | < 3.9.10 | 3.9.10 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from using WeakMap.prototype.set
without proper sandbox protection in the Error stack trace handling mechanism. The commit diff shows the fix changed from using prototype methods (wrappedPrepareStackTrace.set
) to direct WeakMap
method calls via localReflectApply
with a preserved localWeakMapSet
reference. This indicates the original prototype-based access was vulnerable to manipulation from within the sandbox, as demonstrated in the PoC that overrides WeakMap.prototype.set
to compromise the sandbox.