GHSA-3988-h75v-hwf6: Squizlabs/php codesniffer Arbitrary Shell Execution Vulnerability

HIGH
Published
Advisory Summary

GHSA-3988-h75v-hwf6 is a HIGH arbitrary shell execution vulnerability (General Security Weakness) affecting Squizlabs/php codesniffer libraries in the Packagist ecosystem. The issue involves arbitrary shell execution. Remediation is available by upgrading affected packages to version 3.0.1.

GHSA-3988-h75v-hwf6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-3988-h75v-hwf6
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Squizlabs/php codesniffer
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix GHSA-3988-h75v-hwf6

To remediate this vulnerability, upgrade all affected Squizlabs/php codesniffer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

squizlabs/php_codesniffer fixed: 3.0.1
Upgrade squizlabs/php_codesniffer to 3.0.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for squizlabs/php_codesniffer

How to Check if You Are Affected

To determine whether your application is affected by GHSA-3988-h75v-hwf6, inspect your project dependencies for Squizlabs/php codesniffer:

inspect dependencies for squizlabs/php_codesniffer

Analyze the terminal output to locate any version of Squizlabs/php codesniffer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under General Security Weakness. In Squizlabs/php codesniffer, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

GHSA-3988-h75v-hwf6 Affected Squizlabs/php codesniffer Versions

1 component(s)
Fixed Versions:
3.0.1
Product / Package Ecosystem Affected Versions Fixed Version
squizlabs/php_codesniffer
Packagist
≥ 3.0.0
< 3.0.1
3.0.1

References

Frequently Asked Questions

What is GHSA-3988-h75v-hwf6?
GHSA-3988-h75v-hwf6 is a security vulnerability in Squizlabs/php codesniffer involving Arbitrary shell execution under General Security Weakness.
Which Squizlabs/php codesniffer versions are affected?
Affected versions include releases prior to 3.0.1 across affected packages: squizlabs/php_codesniffer.
What version fixes GHSA-3988-h75v-hwf6?
Upgrading to 3.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is squizlabs/php_codesniffer affected?
Yes, squizlabs/php_codesniffer is affected in releases prior to 3.0.1. Upgrade your dependency to 3.0.1 or later.
What CWE is associated with GHSA-3988-h75v-hwf6?
GHSA-3988-h75v-hwf6 is classified under General Security Weakness.
How can I check Packagist dependencies for GHSA-3988-h75v-hwf6?
Run the dependency tree command: 'inspect dependencies for squizlabs/php_codesniffer'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3988-h75v-hwf6",
  "modified" : "2022-03-26T00:06:45Z",
  "published" : "2022-03-26T00:06:45Z",
  "aliases" : [ ],
  "summary" : "Arbitrary shell execution",
  "details" : "A properly crafted filename would allow for arbitrary code execution when using the --filter=gitmodified command line option",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "squizlabs/php_codesniffer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/FriendsOfPHP/security-advisories/blob/master/squizlabs/php_codesniffer/2017-05-18.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/squizlabs/PHP_CodeSniffer"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.0.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-26T00:06:45Z",
    "nvd_published_at" : null
  }
}