GHSA-hmqg-cxww-wqhq
PHP_CodeSniffer gitblame report command injection via crafted filename
Quick fix
GHSA-hmqg-cxww-wqhq — squizlabs/php_codesniffer: upgrade to the fixed version with the command below.
composer require squizlabs/php_codesniffer:^3.13.6 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](https://github.com/Faze-up) and [@edorian](https://github.com/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](https://github.com/PHPCSStandards/PHP_CodeSniffer/security).
Are you affected?
Enter the version of the package you're using.
Affected packages
0 Fixed in: 3.13.6 composer require squizlabs/php_codesniffer:^3.13.6 4.0.0 Fixed in: 4.0.2 composer require squizlabs/php_codesniffer:^4.0.2 References
- https://github.com/PHPCSStandards/PHP_CodeSniffer/security/advisories/GHSA-hmqg-cxww-wqhq [WEB]
- https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1473 [WEB]
- https://github.com/PHPCSStandards/PHP_CodeSniffer/commit/7a3a6bbf153a03fa3a9413afc60bded6b764e76b [WEB]
- https://github.com/PHPCSStandards/PHP_CodeSniffer/commit/f0e1ebb0563f0e5d7f190497a787bcaf8474f3fe [WEB]
- https://github.com/FriendsOfPHP/security-advisories/blob/master/squizlabs/php_codesniffer/CVE-2026-67434.yaml [WEB]
- https://github.com/PHPCSStandards/PHP_CodeSniffer [PACKAGE]
- https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.13.6 [WEB]
- https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/4.0.2 [WEB]