PT-2026-68964 · Packagist · Squizlabs/Php Codesniffer
Published
2026-08-06
·
Updated
2026-08-06
CVSS v4.0
7.3
High
| Vector | AV:L/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
Impact
PHP CodeSniffer versions before v3.13.6 and v4.0.2 contain a command injection vulnerability in the code creating the
Gitblame, Hgblame and Svnblame report(s).As a result, running PHP CodeSniffer over untrusted files, for example, in a CI 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(s) would process a file whose name contains shell metacharacters.- Users using the default
Fullreport, 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.
Patched versions
The issue has been fixed in PHP CodeSniffer v3.13.6 and v4.0.2. We recommend all users upgrade to these versions at their earliest convenience.
Workaround
Users of PHP CodeSniffer who cannot upgrade immediately should ensure they do not use the
Gitblame, Hgblame or the Svnblame reports when scanning untrusted code.This is especially relevant for CI jobs, pre-commit or review tooling, automated review services, and any service that scans untrusted repositories or uploaded source trees.
Credits
How can I report a security bug?
Please report security vulnerabilities privately via [the "Security and quality" tab on the PHP CodeSniffer repository](https://github.com/PHPCSStandards/PHP CodeSniffer/security).
Exploit
Fix
OS Command Injection
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
Squizlabs/Php Codesniffer