CVE-2022-25860: simple-git remote code execution in clone, pull, and push

CVE-2022-25860 · Severity: low · CVSS 3.1 · Published 2023-01-26

simple-git is a Node.js library used by developers to programmatically execute Git operations. An attacker can execute arbitrary code on a server or workstation using simple-git by crafting malicious Git repository URLs or arguments that bypass input validation. This could allow an attacker to take full control of the affected system, steal source code or credentials, or deploy malware.

Technologies: simple-git (npm). Vendors: npm.

Quick answers

Is CVE-2022-25860 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2022-25860 being exploited in the wild.
How severe is CVE-2022-25860?
Low severity, with a CVSS score of 3.1, published 26 January 2023.
Which products and versions are affected?
simple-git (npm) SEMVER:introduced=0,fixed=3.16.0.
Is there a fix for CVE-2022-25860?
Yes. simple-git (npm): upgrade to 3.16.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2022-25860 attacked?
It is attacked over the network.
Am I affected by CVE-2022-25860?
Check whether you run simple-git (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • simple-git (npm): upgrade to 3.16.0 or later
    npm install simple-git@3.16.0

Technical details

This vulnerability is a remote code execution (RCE) flaw affecting simple-git versions before 3.16.0, caused by incomplete input sanitization in the clone(), pull(), push(), and listRemote() methods. The root cause is an incomplete fix for CVE-2022-25912; attackers can inject malicious command-line arguments (such as --upload-pack or --receive-pack) that are passed unsafely to underlying Git commands. The attack is network-reachable and requires no authentication—an attacker only needs to control a Git repository URL or convince an application to use a crafted URL. This allows arbitrary command injection leading to remote code execution with the privileges of the Node.js process. The vulnerability is fixed in version 3.16.0, which requires explicit opt-in via the allowUnsafePack option to use such arguments.

Affected products

  • simple-git simple-git before 3.16.0

Identifiers

  • CVE-2022-25860
  • GHSA-9w5j-4mwv-2wj8

Timeline

  • 2023-01-26: disclosed
  • 2022-12-22: patched: fix merged in PR #881

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.