# CVE-2026-67434: PHP_CodeSniffer gitblame report command injection via crafted filename

> Attackers can execute arbitrary shell commands via crafted filenames when using specific blame report formats in PHP_CodeSniffer.

- **Severity:** High 7.3 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 6 Aug 2026
- **Updated:** 7 Aug 2026
- **Also known as:** GHSA-hmqg-cxww-wqhq, MINI-3mh5-p945-wp98, MINI-7289-cjm8-fvfr, MINI-h4g7-8gqp-x5mr

## What is CVE-2026-67434?

CVE-2026-67434 is a high-severity command injection vulnerability in PHPCSStandards PHP_CodeSniffer, published on 6 Aug 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official 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.

Weakness: CWE-78 (Improper Neutralization of Special Elements used in an OS Command)

## Which versions are affected by CVE-2026-67434?

4 open source packages ship an affected version, including squizlabs/php_codesniffer.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `squizlabs/php_codesniffer` | Packagist | All versions | 3.13.6 |
| `squizlabs/php_codesniffer` | Packagist | All versions | 3.13.6 |
| `squizlabs/php_codesniffer` | Packagist | From 4.0.0 | 4.0.2 |
| `squizlabs/php_codesniffer` | Packagist | From 4.0.0 | 4.0.2 |

## How do I fix CVE-2026-67434?

Upgrade squizlabs/php_codesniffer to a fixed version for your release line: 3.13.6 or 4.0.2.

## Is CVE-2026-67434 being exploited?

There is no known exploitation of CVE-2026-67434 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-67434 and fix it if it is affected.

What it is: CVE-2026-67434 is a high-severity command injection vulnerability in PHPCSStandards PHP_CodeSniffer, published on 6 Aug 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-67434 in the wild and no public exploit code.

Affected packages and fixed versions:
- squizlabs/php_codesniffer (Packagist): affected all versions; fixed in 3.13.6
- squizlabs/php_codesniffer (Packagist): affected all versions; fixed in 3.13.6
- squizlabs/php_codesniffer (Packagist): affected from 4.0.0; fixed in 4.0.2
- squizlabs/php_codesniffer (Packagist): affected from 4.0.0; fixed in 4.0.2

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-67434/ (Markdown: https://insights.sbomify.com/CVE-2026-67434/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-67434
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-67434
- OSV: https://osv.dev/vulnerability/CVE-2026-67434

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-67434/
Summaries are generated and may contain mistakes; the official description above is the record.
