Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. codeceptjs
  4. ›
  5. CVE-2025-57285

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

September 8, 2025 (updated September 23, 2025)

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.

References

  • gist.github.com/Dremig/1ba111f9b1f7cffe1fcb4838b64e55b9
  • github.com/advisories/GHSA-34w8-mcwr-vg29
  • github.com/codeceptjs/CodeceptJS
  • github.com/codeceptjs/CodeceptJS/pull/3604
  • github.com/codeceptjs/CodeceptJS/pull/5190
  • nvd.nist.gov/vuln/detail/CVE-2025-57285
  • www.npmjs.com/

Code Behaviors & Features

Detect and mitigate CVE-2025-57285 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 3.5.0 before 3.7.5

Fixed versions

  • 3.7.5

Solution

Upgrade to version 3.7.5 or above.

Impact 9.8 CRITICAL

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Learn more about CVSS

Weakness

  • CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection')

Source file

npm/codeceptjs/CVE-2025-57285.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:56 +0000.