Skip to content

Commit 4a6ca7a

Browse files
tniessenRafaelGSS
authored andcommitted
src: remove erroneous CVE-2024-27980 revert option
No security reverts should exist on the main branch. PR-URL: #52543 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 08ff4a0 commit 4a6ca7a

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

src/node_revert.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
**/
1616
namespace node {
1717

18-
#define SECURITY_REVERSIONS(XX) \
19-
XX(CVE_2024_27980, "CVE-2024-27980", "Unsafe Windows batch file execution")
20-
// XX(CVE_2016_PEND, "CVE-2016-PEND", "Vulnerability Title")
18+
#define SECURITY_REVERSIONS(XX) \
19+
// XX(CVE_2016_PEND, "CVE-2016-PEND", "Vulnerability Title")
2120

2221
enum reversion {
2322
#define V(code, ...) SECURITY_REVERT_##code,

src/util-inl.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,8 @@ bool IsWindowsBatchFile(const char* filename) {
648648
static constexpr bool kIsWindows = false;
649649
#endif // _WIN32
650650
if (kIsWindows)
651-
if (!IsReverted(SECURITY_REVERT_CVE_2024_27980))
652-
if (const char* p = strrchr(filename, '.'))
653-
return StringEqualNoCase(p, ".bat") || StringEqualNoCase(p, ".cmd");
651+
if (const char* p = strrchr(filename, '.'))
652+
return StringEqualNoCase(p, ".bat") || StringEqualNoCase(p, ".cmd");
654653
return false;
655654
}
656655

test/parallel/test-child-process-spawn-windows-batch-file.js

+1-12
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,13 @@ const cp = require('child_process');
1919
const assert = require('assert');
2020
const { isWindows } = common;
2121

22-
const arg = '--security-revert=CVE-2024-27980';
23-
const isRevert = process.execArgv.includes(arg);
24-
25-
const expectedCode = isWindows && !isRevert ? 'EINVAL' : 'ENOENT';
22+
const expectedCode = isWindows ? 'EINVAL' : 'ENOENT';
2623
const expectedStatus = isWindows ? 1 : 127;
2724

2825
const suffixes =
2926
'BAT bAT BaT baT BAt bAt Bat bat CMD cMD CmD cmD CMd cMd Cmd cmd'
3027
.split(' ');
3128

32-
if (process.argv[2] === undefined) {
33-
const a = cp.spawnSync(process.execPath, [__filename, 'child']);
34-
const b = cp.spawnSync(process.execPath, [arg, __filename, 'child']);
35-
assert.strictEqual(a.status, 0);
36-
assert.strictEqual(b.status, 0);
37-
return;
38-
}
39-
4029
function testExec(filename) {
4130
return new Promise((resolve) => {
4231
cp.exec(filename).once('exit', common.mustCall(function(status) {

0 commit comments

Comments
 (0)