CVE-2026-67434: PHP_CodeSniffer gitblame report command injection via crafted filename

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.

Other sources

PHPCodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards. Prior to versions 3.13.6 and 4.0.2, PHPCodeSniffer contains a command injection vulnerability in the code that generates the Gitblame, Hgblame, and Svnblame report formats. As a result, running PHPCodeSniffer over untrusted files, for example in a continuous integration 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 processes 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. This issue is fixed in versions 3.13.6 and 4.0.2.

MITRE

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 from versions before v3.13.6 and v4.0.2, do not use the Gitblame, Hgblame, or Svnblame report(s) when scanning untrusted code.

    PHP_CodeSniffer report formats (Gitblame/Hgblame/Svnblame) Use of Gitblame, Hgblame, Svnblame reports = disabled

Event History

Aug 6, 2026
CVE Published
via MITRE·09:31 PM
Data Sourced
via MITRE·09:31 PM
DescriptionWeakness
Advisory Published
via GitHub·09:31 PM
Data Sourced
via GitHub·09:31 PM
DescriptionWeaknessAffected Software
Data Sourced
via NVD·10:18 PM
DescriptionSeverityWeakness
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 CVE-2026-67434?

CVE-2026-67434 has a risk rating of 60, indicating a moderate severity level.

2

What vulnerability does CVE-2026-67434 represent?

CVE-2026-67434 represents a command injection vulnerability in PHP_CodeSniffer affecting specific report generation functions.

3

How do I fix CVE-2026-67434?

To fix CVE-2026-67434, upgrade PHP_CodeSniffer to version 3.13.6 or 4.0.2 or later.

4

What software is affected by CVE-2026-67434?

CVE-2026-67434 affects PHP_CodeSniffer versions prior to 3.13.6 and 4.0.2.

5

In what scenarios is CVE-2026-67434 a risk?

CVE-2026-67434 poses a risk when running PHP_CodeSniffer on untrusted files, particularly in CI pipelines.

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