External risk intelligence

CodeceptJS emptyFolder Command Injection

CVE advisorySeverity: CRITICAL (CVSS 9.8)

CVE-2025-57285

CodeceptJS is a testing framework used by developers for automated testing. It is a build-time or development-time tool that runs in local or CI/CD environments, not an internet-facing service, API, or appliance. Exposure to the public internet is not a characteristic of its standard deployment or intended use.

Command Injection

Codeceptjs

3.7.3

Halo Surface Signal: 1 out of 5 — much less likely to be public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

This advisory concerns a critical command injection vulnerability found in the codeceptjs testing framework. The flaw allows unauthenticated attackers to execute arbitrary commands on a system by manipulating a directory path. While the direct impact is unclear due to the nature of the affected technology, any exposure of this tool to untrusted input could be significant.

  • Flaw lets attackers run commands remotely.
  • Test tools may be exposed to attack.
  • Confirm relevance and assess exposure.

Attack Path

How an attacker could exploit the issue

An attacker could exploit this vulnerability by submitting a crafted input to the `emptyFolder` function within the codeceptjs testing framework. This function directly uses user-provided data to construct a command, bypassing necessary security checks. If codeceptjs is running in an environment accessible to an attacker, they could potentially execute arbitrary commands on the system.

  • Requires access to codeceptjs.
  • Triggered by crafted function input.
  • Enables arbitrary command execution.

Live Threat

Current exploitation, exposure, and threat context

When supported by the advisory, this vulnerability could allow an unauthenticated attacker to execute arbitrary commands on a system running codeceptjs. This occurs when the `emptyFolder` function directly concatenates user-controlled input into an `execSync` command without proper sanitization, potentially impacting the integrity and availability of the affected system.

  • Arbitrary command execution.
  • Via unsanitized user input.
  • System compromise possible.

Operational Fix

Recommended remediation, mitigation, and detection steps

The `codeceptjs` testing framework's `emptyFolder` function presents a critical command injection risk due to unsanitized user input. Responsibility for addressing this likely falls to development teams or platform engineers managing CI/CD pipelines, alongside security teams for overall risk assessment. The immediate priority is to identify all instances of `codeceptjs`, determine their reachability and criticality, and then plan remediation, potentially involving vendor coordination for updates or implementing compensating controls if direct patching is not feasible.

  • Application or platform engineering teams own resolution.
  • Verify `codeceptjs` instances and their exposure.
  • Plan updates or mitigate risk with controls.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is CodeceptJS?

CodeceptJS is a popular testing framework built for Node.js. Developers use it to write automated acceptance and end-to-end tests that simulate user behavior across web applications, helping ensure software quality during the development and build phases.

What does CVE-2025-57285 mean?

This CVE identifies a command injection vulnerability, classified as CWE-77. It means the software fails to properly filter input, allowing a malicious actor to inject and execute their own system commands instead of just performing the intended folder-cleaning operation.

How is this command injection triggered?

The flaw is triggered when the emptyFolder function processes a malicious directory path string. It does not trigger during standard, trusted testing activities; it specifically requires the function to receive and process crafted, unsanitized input provided by an external source.

Is my system at risk from this vulnerability?

According to Halo Surface Signal, this is very unlikely. CodeceptJS is a development tool used in local or CI/CD environments, not an internet-facing service. The risk depends on whether you have exposed this build-time tool to untrusted network inputs.

What steps should I take if I use CodeceptJS?

Identify where CodeceptJS is utilized within your CI/CD pipelines or local development workflows. Evaluate whether any part of your process passes external, untrusted data into its functions. Consult your development team to prioritize updates and verify secure configuration.

References