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.
Recommendation
Update the codeceptjs package to the latest compatible version. Followings are version details:
- Affected version(s): >= 3.5.0, < 3.7.5
- Patched version(s): 3.7.5
References
Could your website be exposed too?
SmartScanner can check your website for CodeceptJS's incomprehensive sanitation can lead to Command Injection and gives you actionable findings to investigate.
Start a free scanRelated Issues
- Happy DOM: VM Context Escape can lead to Remote Code Execution - CVE-2025-61927
- MCPHub's ServerController is vulnerable to Command Injection - CVE-2025-11285
- Matrix IRC Bridge allows IRC command injection to own puppeted user - CVE-2025-27146
- mcp-package-docs vulnerable to command injection in several tools - CVE-2025-54073


