CVE-2023-40185 Shescape on Windows escaping may be bypassed in threaded context

Medium 6.5 Published Updated

Attackers can bypass shell escaping in threaded Windows contexts, potentially leading to command injection if the wrong shell is used.

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

What is CVE-2023-40185?

CVE-2023-40185 is a medium-severity command injection vulnerability in ericcornelissen shescape, published on 23 Aug 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

shescape is simple shell escape library for JavaScript. This may impact users that use Shescape on Windows in a threaded context. The vulnerability can result in Shescape escaping (or quoting) for the wrong shell, thus allowing attackers to bypass protections depending on the combination of expected and used shell. This bug has been patched in version 1.7.4.

Weakness: CWE-150

Which versions are affected by CVE-2023-40185?

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

PackageAffectedFixed in
shescape npmAll versions1.7.4
shescape npmAll versions1.7.4

Products include Shescape Project Shescape.

How do I fix CVE-2023-40185?

Upgrade shescape to 1.7.4 or later.

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

Is CVE-2023-40185 being exploited?

There is no known exploitation of CVE-2023-40185 in the wild and no public exploit code.

Sources

Also known as GHSA-j55r-787p-m549.

Is CVE-2023-40185 in your software?

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

Check your SBOMs for free