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.
Published: 2026-08-06
Score: 7.3 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

Fri, 07 Aug 2026 16:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 07 Aug 2026 10:30:00 +0000

Type Values Removed Values Added
First Time appeared Phpcsstandards
Phpcsstandards php Codesniffer
Vendors & Products Phpcsstandards
Phpcsstandards php Codesniffer

Thu, 06 Aug 2026 22:15:00 +0000

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'}


Subscriptions

Phpcsstandards Php Codesniffer
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-07T15:37:19.375Z

Reserved: 2026-07-29T15:07:24.991Z

Link: CVE-2026-67434

cve-icon Vulnrichment

Updated: 2026-08-07T15:37:12.704Z

cve-icon NVD

Status : Received

Published: 2026-08-06T22:18:21.750

Modified: 2026-08-07T16:17:27.077

Link: CVE-2026-67434

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-07T09:58:47Z

Weaknesses
  • CWE-78

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