CVE-2026-67434

PHP_CodeSniffer gitblame report command injection via crafted filename

Published Aug 6, 2026 CVSS 4.0 · 7.3 High EPSS 1.1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability is a command injection that occurs in the generation of Gitblame, Hgblame, and Svnblame report formats in PHP_CodeSniffer before versions 3.13.6 and 4.0.2. A crafted filename that contains shell metacharacters can cause PHP_CodeSniffer to execute arbitrary shell commands when it processes the file. This allows an attacker controlling the filename to run commands with the privileges of the PHP_CodeSniffer process, potentially leading to system compromise.

Affected Systems

The affected vendor is PHPCSStandards, product PHP_CodeSniffer. Any installation of PHP_CodeSniffer with a version older than 3.13.6 or older than 4.0.2 is vulnerable. Only the blame report generation path is impacted; other report formats and the Full report are not affected.

Risk and Exploitability

The CVSS score is 7.3, indicating high severity. The EPSS score is not available, and the vulnerability is not listed in CISA’s KEV catalog. The likely attack vector would be a continuous integration pipeline or any environment where PHP_CodeSniffer scans untrusted files, such as pull requests or third‑party code. Systems that allow filenames containing shell metacharacters are at risk; platforms that disallow such characters are not affected.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade PHP_CodeSniffer to version 3.13.6 or later, and preferably to 4.0.2, which contain the fixed code.
  • If the upgrade cannot be performed immediately, run PHP_CodeSniffer using a non‑blame report format, such as the Full report, to avoid executing the vulnerable code path.
  • Sanitize all filenames processed by PHP_CodeSniffer, removing shell metacharacters, and restrict the tool to trusted directories only.

Generated by OpenCVE AI on August 7, 2026 at 00:41 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-hmqg-cxww-wqhq PHP_CodeSniffer gitblame report command injection via crafted filename
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Phpcsstandards
Phpcsstandards php Codesniffer
Vendors & Products Phpcsstandards
Phpcsstandards php Codesniffer
Type Values Removed Values Added
Description 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.
Title PHP_CodeSniffer gitblame report command injection via crafted filename
Weaknesses CWE-78
References
Metrics cvssV4_0

{'score': 7.3, 'vector': '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'}

Weaknesses
  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 7, 2026, 3:37 PM
Reserved
Jul 29, 2026, 3:07 PM
Status
Awaiting Analysis
Published
Aug 6, 2026, 10:18 PM
Modified
Oct 24, 2026, 4:10 PM