CVE-2022-25866 Command Injection
Attackers can execute arbitrary commands via argument injection in the isRemoteUrlReadable function of the czproject/git-php library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2022-25866?
CVE-2022-25866 is a high-severity command injection vulnerability in czproject/git-php, published on 25 Apr 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-88
Which versions are affected by CVE-2022-25866?
2 open source packages ship an affected version, including czproject/git-php. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
czproject/git-php Packagist | All versions | 4.0.3 |
czproject/git-php Packagist | All versions | 4.0.3 |
Products include Git-Php Project Git-Php.
How do I fix CVE-2022-25866?
Upgrade czproject/git-php to 4.0.3 or later.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2022-25866 being exploited?
There is no known exploitation of CVE-2022-25866 in the wild and no public exploit code.
Sources
Also known as GHSA-3xpw-vhmv-cw7h, SNYK-PHP-CZPROJECTGITPHP-2421349.