mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 09:52:21 +00:00

Refs: https://github.com/v8/v8/wiki/Untrusted-code-mitigations PR-URL: https://github.com/nodejs/node/pull/19222 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benedikt Meurer <benedikt.meurer@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
19 lines
579 B
JavaScript
19 lines
579 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { execFileSync } = require('child_process');
|
|
|
|
// This test checks that untrusted code mitigations in V8 are disabled
|
|
// by default.
|
|
|
|
const v8Options = execFileSync(process.execPath, ['--v8-options']).toString();
|
|
|
|
const untrustedFlag = v8Options.indexOf('--untrusted-code-mitigations');
|
|
assert.notStrictEqual(untrustedFlag, -1);
|
|
|
|
const nextFlag = v8Options.indexOf('--', untrustedFlag + 2);
|
|
const slice = v8Options.substring(untrustedFlag, nextFlag);
|
|
|
|
assert(slice.match(/type: bool default: false/));
|