Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.9.11 #469

Merged
merged 2 commits into from Aug 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
v3.9.11 (2022-08-28)
--------------------
[new] Add option `require.strict` to allow to load required modules in non strict mode.
[fix] Security fix.

v3.9.10 (2022-07-05)
-------------------
[new] Add uptime to process.
Expand Down
3 changes: 2 additions & 1 deletion lib/setup-sandbox.js
Expand Up @@ -67,7 +67,8 @@ Object.defineProperties(global, {
global: {value: global, writable: true, configurable: true, enumerable: true},
globalThis: {value: global, writable: true, configurable: true},
GLOBAL: {value: global, writable: true, configurable: true},
root: {value: global, writable: true, configurable: true}
root: {value: global, writable: true, configurable: true},
Error: {value: LocalError}
});

if (!localReflectDefineProperty(global, 'VMError', {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -13,7 +13,7 @@
"alcatraz",
"contextify"
],
"version": "3.9.10",
"version": "3.9.11",
"main": "index.js",
"sideEffects": false,
"repository": "github:patriksimek/vm2",
Expand Down
7 changes: 7 additions & 0 deletions test/vm.js
Expand Up @@ -1070,6 +1070,13 @@ describe('VM', () => {
Error.prepareStackTrace = undefined;
stack.process
`));
assert.throws(()=>vm2.run(`(()=>{
const OldError = Error;
global.Error = {prepareStackTrace: (_, c) => c.map(c => c.getThis()).find(a => a && a.process)};
const { stack } = new OldError();
global.Error = OldError;
return stack.process.mainModule;
})()`));
});

it('Node internal prepareStackTrace attack', () => {
Expand Down