From 66b6aaad198eef12772229cc076b77c26dee0165 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 23 Aug 2022 08:48:33 -0400 Subject: [PATCH] Add 'fork' to child_process hardening tests (#139222) (#139292) (cherry picked from commit bdbd227bb1c508e68a1857f3e6216c576dd77dee) Co-authored-by: Larry Gregory --- test/harden/child_process.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/harden/child_process.js b/test/harden/child_process.js index cd1c54aa5db2..f15f5aceb39e 100644 --- a/test/harden/child_process.js +++ b/test/harden/child_process.js @@ -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/);