CVE-2021-21384 Null characters not escaped in shescape

Medium 6.3 Published Updated

Attackers can execute arbitrary shell commands by injecting null characters into payloads processed by the shescape library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2021-21384?

CVE-2021-21384 is a medium-severity command injection vulnerability in ericcornelissen shescape, published on 18 Mar 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

shescape is a simple shell escape package for JavaScript. In shescape before version 1.1.3, anyone using _Shescape_ to defend against shell injection may still be vulnerable against shell injection if the attacker manages to insert a into the payload. For an example see the referenced GitHub Security Advisory. The problem has been patched in version 1.1.3. No further changes are required.

Weakness: CWE-88

Which versions are affected by CVE-2021-21384?

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

PackageAffectedFixed in
shescape npmAll versions1.1.3
shescape npmAll versions1.1.3

Products include Shescape Project Shescape.

How do I fix CVE-2021-21384?

Upgrade shescape to 1.1.3 or later.

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

Is CVE-2021-21384 being exploited?

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

Sources

Also known as GHSA-f2rp-38vg-j3gh.

Is CVE-2021-21384 in your software?

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

Check your SBOMs for free