CVE-2022-24437

9.8 CRITICAL

📋 TL;DR

CVE-2022-24437 is a critical command injection vulnerability in git-pull-or-clone npm package that allows attackers to execute arbitrary commands on systems using vulnerable versions. The vulnerability exists in how the package handles the --upload-pack parameter during git clone operations. Any application or service using git-pull-or-clone before version 2.0.2 is affected.

💻 Affected Systems

Products:
  • git-pull-or-clone npm package
Versions: All versions before 2.0.2
Operating Systems: All operating systems where Node.js and git-pull-or-clone are installed
Default Config Vulnerable: ⚠️ Yes
Notes: Any application or service that uses git-pull-or-clone with user-controlled input for repository URLs or parameters is vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Full remote code execution with the privileges of the process running git-pull-or-clone, potentially leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

Arbitrary command execution allowing attackers to install malware, exfiltrate sensitive data, or pivot to other systems in the network.

🟢

If Mitigated

Limited impact if running with minimal privileges, network segmentation, and proper input validation controls are in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires the ability to control input to git-pull-or-clone functions, which is common in CI/CD pipelines, deployment scripts, or applications that clone user-specified repositories.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.0.2

Vendor Advisory: https://github.com/feross/git-pull-or-clone/commit/f9ce092be13cc32e685dfa26e7705e9c6e3108a3

Restart Required: No

Instructions:

1. Update package.json to require git-pull-or-clone version 2.0.2 or higher. 2. Run npm update git-pull-or-clone. 3. Test your application to ensure compatibility with the updated version.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict input validation for repository URLs and parameters passed to git-pull-or-clone functions.

Run with Minimal Privileges

all

Execute processes using git-pull-or-clone with the least privileges necessary.

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all user-controlled inputs to git-pull-or-clone functions
  • Run affected services in isolated containers or VMs with network restrictions and minimal privileges

🔍 How to Verify

Check if Vulnerable:

Check package.json or package-lock.json for git-pull-or-clone version. If version is less than 2.0.2, the system is vulnerable.

Check Version:

npm list git-pull-or-clone

Verify Fix Applied:

Verify that git-pull-or-clone version is 2.0.2 or higher in package.json and that npm list git-pull-or-clone shows the updated version.

📡 Detection & Monitoring

Log Indicators:

  • Unusual git clone commands with --upload-pack parameters containing shell metacharacters
  • Process execution of unexpected commands following git operations

Network Indicators:

  • Outbound connections to unexpected destinations following git clone operations
  • Unusual command and control traffic patterns

SIEM Query:

process.name:git AND command_line:*upload-pack* AND command_line:*;* OR command_line:*&* OR command_line:*|*

🔗 References

📤 Share & Export