Vulnerability library
Security checkSeptember 23, 2025

CodeceptJS's incomprehensive sanitation can lead to Command Injection

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

High severitynpmcodeceptjs

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

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 scan

Related Issues

See something that needs correcting? Let us knowUpdated September 23, 2025