GHSA-hmqg-cxww-wqhq

    Dashboard / Vulnerabilities / GHSA-hmqg-cxww-wqhq

    GHSA-hmqg-cxww-wqhq

    Published: 6 Aug 2026Last Modified: 6 Aug 2026

    Summary: PHP_CodeSniffer gitblame report command injection via crafted filename

    Details: ### 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 `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. ### 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 Many thanks to both [@Faze-up](https://github.com/Faze-up) and [@edorian](https://github.com/edorian) for responsibly disclosing this vulnerability. ### 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).

    Affected packages

    Package

    Name: squizlabs/php_codesniffer

    Purl: pkg:composer/squizlabs/php_codesniffer

    Affected ranges

    Type: ECOSYSTEM

    Events:

    Introduced- 0
    Fixed -3.13.6

    Affected versions

    1.4.2
    1.4.3
    1.4.4
    1.4.5
    1.4.6
    1.4.7
    1.4.8

    Common Vulnerability Scoring System

    Attack Vector
    Network
    Adjacent
    Local
    Physical
    Privileges Required
    None
    Low
    High
    User Interaction
    None
    Required
    Scope
    Unchanged
    Changed
    Confidentiality
    None
    Low
    High
    Integrity
    None
    Low
    High
    Availability
    None
    Low
    High
    GHSA-hmqg-cxww-wqhq | CVE-DB