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

Critical 9.8 Published Updated

Attackers can execute arbitrary commands via unsanitized input in the emptyFolder function of the CodeceptJS testing library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-57285?

CVE-2025-57285 is a critical command injection vulnerability in n/a, published on 8 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

codeceptjs 3.7.3 contains 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.

Weakness: CWE-77

Which versions are affected by CVE-2025-57285?

2 open source packages ship an affected version, including codeceptjs. It affects 1 product.

PackageAffectedFixed in
codeceptjs npmFrom 3.5.03.7.5
codeceptjs npmFrom 3.5.03.7.5

Products include Codecept Codeceptjs.

How do I fix CVE-2025-57285?

Upgrade codeceptjs to 3.7.5 or later.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2025-57285 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-57285 exists.

Sources

Also known as GHSA-34w8-mcwr-vg29.

Is CVE-2025-57285 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free