PHP_CodeSniffer gitblame report command injection via crafted filename
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
Fullreport, 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.
Software afectado
Haz clic en una tecnología para ver todas sus vulnerabilidades.
| Plataforma | Paquete | Versiones vulnerables | Corregida en |
|---|---|---|---|
| Paquete de Composer | squizlabs/php_codesniffer | < 3.13.6, >= 4.0.0, < 4.0.2 | 3.13.6, 4.0.2 |
Referencias
- https://github.com/PHPCSStandards/PHP_CodeSniffer/security/advisories/GHSA-hmqg-cxww-wqhq
- https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1473
- https://github.com/PHPCSStandards/PHP_CodeSniffer/commit/7a3a6bbf153a03fa3a9413afc60bded6b764e76b
- https://github.com/PHPCSStandards/PHP_CodeSniffer/commit/f0e1ebb0563f0e5d7f190497a787bcaf8474f3fe
- https://github.com/FriendsOfPHP/security-advisories/blob/master/squizlabs/php_codesniffer/CVE-2026-67434.yaml
- https://github.com/PHPCSStandards/PHP_CodeSniffer
- https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.13.6
- https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/4.0.2
- Vector CVSS
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- Debilidad (CWE)
CWE-78- Plataforma
- Composer
- Paquete
squizlabs/php_codesniffer- Publicada
- 06.08.2026
- Actualizado
- 11.10.2026 10:22
Fuentes y licencias
OSV / GitHub Advisory Database - GHSA-hmqg-cxww-wqhq - CC BY 4.0
Historial de vulnerabilidades: squizlabs/php_codesniffer
Todas las vulnerabilidades publicadas de este paquete (Paquete de Composer), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.
- Entradas en total
- 3
- Primera → última
- 03.2022 08.2026
- Sin corrección
- 0
- Explotada en ataques
- 0
Distribución por gravedad
- Alta 3
Divulgaciones por año
- 2022: 2
- 2023: 0
- 2024: 0
- 2025: 0
- 2026: 1
-
PHP_CodeSniffer gitblame report command injection via crafted filename esta entrada
Identifica las vulnerabilidades de tu aplicación
Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.