GHSA-hmqg-cxww-wqhq: OS Command Injection

Published Aug 6, 2026
·
Updated

Impact

PHPCodeSniffer 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 PHPCodeSniffer 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 PHPCodeSniffer v3.13.6 and v4.0.2. We recommend all users upgrade to these versions at their earliest convenience.

Workaround

Users of PHPCodeSniffer 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 PHPCodeSniffer repository.

Affected Software

2 affected componentsFixes available
composer/squizlabs/php_codesniffer>=4.0.0<4.0.2
4.0.2
composer/squizlabs/php_codesniffer<3.13.6
3.13.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/squizlabs/php_codesniffer to a version that resolves this vulnerability.

    Fixed in 4.0.2
  2. Upgrade

    Upgrade composer/squizlabs/php_codesniffer to a version that resolves this vulnerability.

    Fixed in 3.13.6
  3. Upgrade

    Upgrade PHP_CodeSniffer to a version that resolves this vulnerability.

    Fixed in 3.13.6
  4. Upgrade

    Upgrade PHP_CodeSniffer to a version that resolves this vulnerability.

    Fixed in 4.0.2
  5. Configuration

    If you cannot upgrade, do not use the Gitblame, Hgblame, or Svnblame report(s) when scanning untrusted code; use other (non-blame) reports instead.

    PHP_CodeSniffer Use of Gitblame/Hgblame/Svnblame reports = Do not use

Event History

Aug 6, 2026
Advisory Published
via GitHub·09:31 PM
Data Sourced
via GitHub·09:31 PM
DescriptionWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of GHSA-hmqg-cxww-wqhq?

GHSA-hmqg-cxww-wqhq has a risk score of 60, indicating a moderate severity level.

2

How do I fix GHSA-hmqg-cxww-wqhq?

To fix GHSA-hmqg-cxww-wqhq, update PHP_CodeSniffer to version 3.13.6 or later, or version 4.0.2 or later.

3

What versions of PHP_CodeSniffer are affected by GHSA-hmqg-cxww-wqhq?

PHP_CodeSniffer versions before v3.13.6 and v4.0.2 are affected by GHSA-hmqg-cxww-wqhq.

4

What type of vulnerability is GHSA-hmqg-cxww-wqhq?

GHSA-hmqg-cxww-wqhq is categorized as a command injection vulnerability.

5

Where can GHSA-hmqg-cxww-wqhq be exploited?

GHSA-hmqg-cxww-wqhq can be exploited when running PHP_CodeSniffer over untrusted files, such as in a CI pipeline that scans pull requests.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203