GHSA-hmqg-cxww-wqhq

Suggest an improvement
Source
https://github.com/advisories/GHSA-hmqg-cxww-wqhq
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/08/GHSA-hmqg-cxww-wqhq/GHSA-hmqg-cxww-wqhq.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-hmqg-cxww-wqhq
Aliases
Downstream
Published
2026-08-06T21:31:34Z
Modified
2026-08-06T21:45:58Z
Severity
  • 7.3 (High) CVSS_V4 - CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N CVSS Calculator
Summary
PHP_CodeSniffer gitblame report command injection via crafted filename
Details

Impact

PHP_CodeSniffer versions before v3.13.6 and v4.0.2 contain a command injection vulnerability in the code creating the Gitblame, Hgblame and Svnblame report(s).

As a result, running PHP_CodeSniffer over untrusted files, for example, in a CI pipeline that scans pull requests, or on a developer machine reviewing third-party code, could result in attacker-controlled shell commands being executed when the Gitblame, Hgblame or Svnblame report(s) would process a file whose name contains shell metacharacters.

  • Users using the default Full report, or any of the other non-*blame reports, are not affected.
  • Users on a runtime platform which does not allow filenames to contain shell metacharacters, such as " and ;, are not affected.

Patched versions

The issue has been fixed in PHP_CodeSniffer v3.13.6 and v4.0.2. We recommend all users upgrade to these versions at their earliest convenience.

Workaround

Users of PHP_CodeSniffer who cannot upgrade immediately should ensure they do not use the Gitblame, Hgblame or the Svnblame reports when scanning untrusted code.

This is especially relevant for CI jobs, pre-commit or review tooling, automated review services, and any service that scans untrusted repositories or uploaded source trees.

Credits

Many thanks to both @Faze-up and @edorian for responsibly disclosing this vulnerability.

How can I report a security bug?

Please report security vulnerabilities privately via the "Security and quality" tab on the PHP_CodeSniffer repository.

Database specific
{
    "cwe_ids": [
        "CWE-78"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-08-06T21:31:34Z",
    "nvd_published_at": null,
    "severity": "HIGH"
}
References

Affected packages

Packagist / squizlabs/php_codesniffer

Package

Name
squizlabs/php_codesniffer
Purl
pkg:composer/squizlabs/php_codesniffer

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
3.13.6

Affected versions

1.*
1.4.2
1.4.3
1.4.4
1.4.5
1.4.6
1.4.7
1.4.8
1.5.0RC1
1.5.0RC2
1.5.0RC3
1.5.0RC4
1.5.0
1.5.1
1.5.2
1.5.3
1.5.4
1.5.5
1.5.6
2.*
2.0.0a1
2.0.0a2
2.0.0RC1
2.0.0RC2
2.0.0RC3
2.0.0RC4
2.0.0
2.1.0
2.2.0
2.3.0
2.3.1
2.3.2
2.3.3
2.3.4
2.4.0
2.5.0
2.5.1
2.6.0
2.6.1
2.6.2
2.7.0
2.7.1
2.8.0
2.8.1
2.9.0
2.9.1
2.9.2
3.*
3.0.0a1
3.0.0RC1
3.0.0RC2
3.0.0RC3
3.0.0RC4
3.0.0
3.0.1
3.0.2
3.1.0
3.1.1
3.2.0
3.2.1
3.2.2
3.2.3
3.3.0
3.3.1
3.3.2
3.4.0
3.4.1
3.4.2
3.5.0
3.5.1
3.5.2
3.5.3
3.5.4
3.5.5
3.5.6
3.5.7
3.5.8
3.6.0
3.6.1
3.6.2
3.7.0
3.7.1
3.7.2
3.8.0
3.8.1
3.9.0
3.9.1
3.9.2
3.10.0
3.10.1
3.10.2
3.10.3
3.11.0
3.11.1
3.11.2
3.11.3
3.12.0
3.12.1
3.12.2
3.13.0
3.13.1
3.13.2
3.13.3
3.13.4
3.13.5

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/08/GHSA-hmqg-cxww-wqhq/GHSA-hmqg-cxww-wqhq.json"

Packagist / squizlabs/php_codesniffer

Package

Name
squizlabs/php_codesniffer
Purl
pkg:composer/squizlabs/php_codesniffer

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.0.0
Fixed
4.0.2

Affected versions

4.*
4.0.0
4.0.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/08/GHSA-hmqg-cxww-wqhq/GHSA-hmqg-cxww-wqhq.json"