critical9.8
CVE-2025-57285
CodeceptJS's incomprehensive sanitation can lead to Command Injection
Impact
CodeceptJS versions 3.5.0 through 3.7.5-beta.18 contain a command injection vulnerability in the emptyFolder function (lib/utils.js). The execSync command directly concatenates the user-controlled directoryPath parameter without sanitization or escaping, allowing attackers to execute arbitrary commands.
Affected packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| npm | codeceptjs | >= 3.5.0, < 3.7.5 | 3.7.5 |
Affected products
| Vendor | Product | Affected versions |
|---|---|---|
| Codecept | Codeceptjs | Version 3.7.3 |
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://gist.github.com/Dremig/1ba111f9b1f7cffe1fcb4838b64e55b9
- https://www.npmjs.com
- https://github.com/advisories/GHSA-34w8-mcwr-vg29
- https://nvd.nist.gov/vuln/detail/CVE-2025-57285
- https://github.com/codeceptjs/CodeceptJS/pull/3604
- https://github.com/codeceptjs/CodeceptJS/pull/5190