Headline
CVE-2022-25893: Security fix for issue 444. by XmiliaH · Pull Request #445 · patriksimek/vm2
The package vm2 before 3.9.10 are vulnerable to Arbitrary Code Execution due to the usage of prototype lookup for the WeakMap.prototype.set method. Exploiting this vulnerability leads to access to a host object and a sandbox compromise.
@@ -51,7 +51,10 @@ const { AsyncGeneratorFunction } = data;
const localWeakMapGet = LocalWeakMap.prototype.get; const { get: localWeakMapGet, set: localWeakMapSet } = LocalWeakMap.prototype;
function localUnexpected() { return new VMError(‘Should not happen’); @@ -282,8 +285,8 @@ if (typeof OriginalCallSite === ‘function’) { } return value(error, sst); }; wrappedPrepareStackTrace.set(value, newWrapped); wrappedPrepareStackTrace.set(newWrapped, newWrapped); localReflectApply(localWeakMapSet, wrappedPrepareStackTrace, [value, newWrapped]); localReflectApply(localWeakMapSet, wrappedPrepareStackTrace, [newWrapped, newWrapped]); currentPrepareStackTrace = newWrapped; } })) throw localUnexpected();
Related news
The package vm2 before 3.9.10 is vulnerable to Arbitrary Code Execution due to the usage of prototype lookup for the WeakMap.prototype.set method. Exploiting this vulnerability leads to access to a host object and a sandbox compromise.