NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2025-57285: CodeceptJS's incomprehensive sanitation can lead to Command Injection

criticalCVSS 3.1 9.8GHSA-34w8-mcwr-vg29

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.

Published Sep 8, 2025 · Updated Sep 23, 2025

Affected packages

codeceptjs

Ecosystem
npm
Affected
>= 3.5.0, < 3.7.5
Fixed in
3.7.5
Check
npm ls codeceptjs

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

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.

Credited to mhassan1.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology