Skip to content

Commit 3a98764

Browse files
committed
Fix security issue
1 parent 245da82 commit 3a98764

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: lib/setup-sandbox.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ const {
5151
AsyncGeneratorFunction
5252
} = data;
5353

54-
const localWeakMapGet = LocalWeakMap.prototype.get;
54+
const {
55+
get: localWeakMapGet,
56+
set: localWeakMapSet
57+
} = LocalWeakMap.prototype;
5558

5659
function localUnexpected() {
5760
return new VMError('Should not happen');
@@ -282,8 +285,8 @@ if (typeof OriginalCallSite === 'function') {
282285
}
283286
return value(error, sst);
284287
};
285-
wrappedPrepareStackTrace.set(value, newWrapped);
286-
wrappedPrepareStackTrace.set(newWrapped, newWrapped);
288+
localReflectApply(localWeakMapSet, wrappedPrepareStackTrace, [value, newWrapped]);
289+
localReflectApply(localWeakMapSet, wrappedPrepareStackTrace, [newWrapped, newWrapped]);
287290
currentPrepareStackTrace = newWrapped;
288291
}
289292
})) throw localUnexpected();

0 commit comments

Comments
 (0)