From fd32e8efe0612601706e4dd76cbc4d70139569c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= Date: Fri, 12 Apr 2024 16:17:07 -0700 Subject: [PATCH] Fix test regression caused by node fixing CVE-2024-27980 (#286) --- lib/src/compiler/async.ts | 4 ++++ lib/src/compiler/sync.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/lib/src/compiler/async.ts b/lib/src/compiler/async.ts index 6b4d77a4..417b82a9 100644 --- a/lib/src/compiler/async.ts +++ b/lib/src/compiler/async.ts @@ -43,6 +43,10 @@ export class AsyncCompiler { // current working directory. // https://github.com/sass/embedded-host-node/pull/261#discussion_r1438712923 cwd: path.dirname(compilerCommand[0]), + // Node blocks launching .bat and .cmd without a shell due to CVE-2024-27980 + shell: ['.bat', '.cmd'].includes( + path.extname(compilerCommand[0]).toLowerCase() + ), windowsHide: true, } ); diff --git a/lib/src/compiler/sync.ts b/lib/src/compiler/sync.ts index 50b7bb33..33838e0e 100644 --- a/lib/src/compiler/sync.ts +++ b/lib/src/compiler/sync.ts @@ -43,6 +43,10 @@ export class Compiler { // current working directory. // https://github.com/sass/embedded-host-node/pull/261#discussion_r1438712923 cwd: path.dirname(compilerCommand[0]), + // Node blocks launching .bat and .cmd without a shell due to CVE-2024-27980 + shell: ['.bat', '.cmd'].includes( + path.extname(compilerCommand[0]).toLowerCase() + ), windowsHide: true, } );