GitHub Advisoryadvisory · npm
GHSA-34w8-mcwr-vg29 CodeceptJS's incomprehensive sanitation can lead to Command Injection
CRITICAL
Official page ↗
- Aliases
- CVE-2025-57285
- Ecosystem
- npm
- Packages
- codeceptjs
- Severity
- Critical
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Weaknesses
- CWE-77
- Reviewed
- 2025-09-10
Affected packages
• npm codeceptjs: >= 3.5.0, < 3.7.5 → fixed in 3.7.5
Description
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.
Related
Alias · CVE (1)
- CVE-2025-57285 codeceptjs 3.7.3 contains a command injection vulnerability in the emptyFolder function (lib/utils.js). vulnerability
Weakness · CWE (1)
- CWE-77 Improper Neutralization of Special Elements used in a Command weakness
References
- https://nvd.nist.gov/vuln/detail/CVE-2025-57285 advisory
- https://github.com/codeceptjs/CodeceptJS/pull/3604 web
- https://github.com/codeceptjs/CodeceptJS/pull/5190 web
- https://gist.github.com/Dremig/1ba111f9b1f7cffe1fcb4838b64e55b9 web
- https://github.com/codeceptjs/CodeceptJS package
- https://www.npmjs.com web