Add 'fork' to child_process hardening tests (#139222) (#139291)

(cherry picked from commit bdbd227bb1)

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
This commit is contained in:
Kibana Machine 2022-08-23 08:52:22 -04:00 committed by GitHub
parent 16f72ad707
commit 98a821dd27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,10 +25,7 @@ test('test setup ok', (t) => {
t.end();
});
// TODO: fork() has been omitted as it doesn't validate its arguments in
// Node.js 10 and will throw an internal error asynchronously. This is fixed in
// newer versions. See https://github.com/elastic/kibana/issues/59628
const functions = ['exec', 'execFile', 'spawn', 'execFileSync', 'execSync', 'spawnSync'];
const functions = ['exec', 'execFile', 'fork', 'spawn', 'execFileSync', 'execSync', 'spawnSync'];
for (const name of functions) {
test(`${name}()`, (t) => {
t.throws(() => cp[name](), /argument must be of type string/);