GHSA-mhfv-8rc9-w38c Arbitrary shell execution

Not scored Published

Attackers can execute arbitrary shell commands due to insufficient escaping of filenames and configuration settings in PHP library functions.

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

What is GHSA-mhfv-8rc9-w38c?

GHSA-mhfv-8rc9-w38c is a command injection vulnerability in squizlabs/php_codesniffer, published on 26 Mar 2022.

Official description

Uses of shell_exec() and exec() were not escaping filenames and configuration settings in most cases

Which versions are affected by GHSA-mhfv-8rc9-w38c?

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

PackageAffectedFixed in
squizlabs/php_codesniffer PackagistFrom 1.0.02.8.1
squizlabs/php_codesniffer PackagistFrom 1.0.02.8.1

How do I fix GHSA-mhfv-8rc9-w38c?

Upgrade squizlabs/php_codesniffer to 2.8.1 or later.

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

Is GHSA-mhfv-8rc9-w38c being exploited?

There is no known exploitation of GHSA-mhfv-8rc9-w38c in the wild and no public exploit code.

Sources

Is GHSA-mhfv-8rc9-w38c in your software?

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

Check your SBOMs for free