GHSA-3988-h75v-hwf6 Arbitrary shell execution

Not scored Published

Attackers can execute arbitrary shell commands via crafted filenames when using the gitmodified filter option.

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 GHSA-3988-h75v-hwf6?

GHSA-3988-h75v-hwf6 is a command injection vulnerability in squizlabs/php_codesniffer, published on 26 Mar 2022. 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

A properly crafted filename would allow for arbitrary code execution when using the –filter=gitmodified command line option

Which versions are affected by GHSA-3988-h75v-hwf6?

2 open source packages ship an affected version, including squizlabs/php_codesniffer.

PackageAffectedFixed in
squizlabs/php_codesniffer PackagistFrom 3.0.03.0.1
squizlabs/php_codesniffer PackagistFrom 3.0.03.0.1

How do I fix GHSA-3988-h75v-hwf6?

Upgrade squizlabs/php_codesniffer to 3.0.1 or later.

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

Is GHSA-3988-h75v-hwf6 being exploited?

There is no known exploitation of GHSA-3988-h75v-hwf6 in the wild and no public exploit code.

Sources

Is GHSA-3988-h75v-hwf6 in your software?

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

Check your SBOMs for free