Skip to content

Commit

Permalink
Add 'fork' to child_process hardening tests (#139222) (#139292)
Browse files Browse the repository at this point in the history
(cherry picked from commit bdbd227)

Co-authored-by: Larry Gregory <larry.gregory@elastic.co>
  • Loading branch information
kibanamachine and legrego authored Aug 23, 2022
1 parent 6648859 commit 66b6aaa
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions test/harden/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/);
Expand Down

0 comments on commit 66b6aaa

Please sign in to comment.