GitHub Advisoryadvisory · npm

GHSA-34w8-mcwr-vg29 CodeceptJS's incomprehensive sanitation can lead to Command Injection

CRITICAL Published 2025-09-08 Modified 2025-09-23 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