CVE-2022-25866: Czproject/git php Command Injection Vulnerability
HIGHCVE-2022-25866 is a HIGH (CVSS 8.1) command injection vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Czproject/git php libraries in the Packagist ecosystem. The issue involves command injection in czproject/git-php. Remediation is available by upgrading affected packages to version 4.0.3.
CVE-2022-25866 at a Glance
Security Impact
CVSS: 8.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-25866
To remediate this vulnerability, upgrade all affected Czproject/git php dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade czproject/git-php to 4.0.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for czproject/git-php
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-25866, inspect your project dependencies for Czproject/git php:
inspect dependencies for czproject/git-php
Analyze the terminal output to locate any version of Czproject/git php in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Czproject/git php, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-25866 Affected Czproject/git php Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
czproject/git-php
|
Packagist |
< 4.0.3
|
4.0.3
|
References
Frequently Asked Questions
What is CVE-2022-25866?
Which Czproject/git php versions are affected?
What version fixes CVE-2022-25866?
Is czproject/git-php affected?
What is the CVSS score of CVE-2022-25866?
What CWE is associated with CVE-2022-25866?
How can I check Packagist dependencies for CVE-2022-25866?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-3xpw-vhmv-cw7h",
"modified" : "2022-04-27T14:35:56Z",
"published" : "2022-04-26T00:00:35Z",
"aliases" : [ "CVE-2022-25866" ],
"summary" : "Command injection in czproject/git-php",
"details" : "The package czproject/git-php before 4.0.3 are vulnerable to Command Injection via git argument injection. When calling the isRemoteUrlReadable($url, array $refs = NULL) function, both the url and refs parameters are passed to the git ls-remote subcommand in a way that additional flags can be set. The additional flags can be used to perform a command injection.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "czproject/git-php"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.0.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-25866"
}, {
"type" : "WEB",
"url" : "https://github.com/czproject/git-php/commit/5e82d5479da5f16d37a915de4ec55e1ac78de733"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/czproject/git-php"
}, {
"type" : "WEB",
"url" : "https://github.com/czproject/git-php/releases/tag/v4.0.3"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-PHP-CZPROJECTGITPHP-2421349"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74", "CWE-77" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-04-27T14:35:56Z",
"nvd_published_at" : "2022-04-25T17:15:00Z"
}
}