PHP_CodeSniffer gitblame report command injection via crafted filename
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- Present
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA and GitHub. Impact type from CWE-78.
Summary
PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards. Prior to versions 3.13.6 and 4.0.2, PHP_CodeSniffer contains a command injection vulnerability in the code that generates the Gitblame, Hgblame, and Svnblame report formats. As a result, running PHP_CodeSniffer 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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| PHPCSStandards | PHP_CodeSniffer | before 3.13.6; 4.0.0 to before 4.0.2 | 3.13.6, 4.0.2 | Patch available | CNA |
| — | squizlabs/php_codesniffer (Packagist) | before 3.13.6 | 3.13.6 | Patch available | GHSA-hmqg-cxww-wqhq |
| — | squizlabs/php_codesniffer (Packagist) | 4.0.0 to before 4.0.2 | 4.0.2 | Patch available | GHSA-hmqg-cxww-wqhq |
- PHP_CodeSniffer VendorPHPCSStandards Affected before 3.13.6; 4.0.0 to before 4.0.2 Fixed in 3.13.6, 4.0.2 Patch available CNA
- squizlabs/php_codesniffer (Packagist) Vendor— Affected before 3.13.6 Fixed in 3.13.6 Patch available GHSA-hmqg-cxww-wqhq
- squizlabs/php_codesniffer (Packagist) Vendor— Affected 4.0.0 to before 4.0.2 Fixed in 4.0.2 Patch available GHSA-hmqg-cxww-wqhq
Remediation
- Fix · CNA PHP_CodeSniffer (PHPCSStandards) Fixed in 3.13.6, 4.0.2
- Fix · GHSA-hmqg-cxww-wqhq squizlabs/php_codesniffer (Packagist) Fixed in 3.13.6 Advisory →
- Fix · GHSA-hmqg-cxww-wqhq squizlabs/php_codesniffer (Packagist) Fixed in 4.0.2 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2026-67434
- 2026-10-03 Alias added: GHSA-hmqg-cxww-wqhq
References
Other 8
- 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/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.13.6
- https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/4.0.2
- https://github.com/FriendsOfPHP/security-advisories/blob/master/squizlabs/php_codesniffer/CVE-2026-67434.yaml
- https://github.com/PHPCSStandards/PHP_CodeSniffer
More PHPCSStandards vulnerabilities
- TI-2026-71240 Eval injection in PHPCSUtils array key handling allows code execution CVSS 3.1HIGH 8.6
Sources
- CVE-2026-67434 · CVE Program
- CVE-2026-67434 · NVD
- FIRST EPSS
- GHSA-hmqg-cxww-wqhq · GitHub Advisory Database · CC BY 4.0
- CVE-2026-67434 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences