CVE-2025-53107
📋 TL;DR
CVE-2025-53107 is a command injection vulnerability in @cyanheads/git-mcp-server that allows remote code execution by injecting shell commands through unsanitized user input. Attackers can exploit this via indirect prompt injection when the server processes git logs. Users of @cyanheads/git-mcp-server versions before 2.1.5 are affected.
💻 Affected Systems
- @cyanheads/git-mcp-server
⚠️ Manual Verification Required
This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.
Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).
🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.
- Review the CVE details at NVD
- Check vendor security advisories for your specific version
- Test if the vulnerability is exploitable in your environment
- Consider updating to the latest version as a precaution
⚠️ Risk & Real-World Impact
Worst Case
Full remote code execution with server process privileges, allowing complete system compromise, data theft, and lateral movement.
Likely Case
Remote code execution leading to unauthorized access, data exfiltration, and potential deployment of malware or ransomware.
If Mitigated
Limited impact if proper input validation and sandboxing are implemented, potentially reducing to denial of service.
🎯 Exploit Status
Exploitation requires an attacker to control input to the MCP client, which can be achieved via indirect prompt injection.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.1.5
Vendor Advisory: https://github.com/cyanheads/git-mcp-server/security/advisories/GHSA-3q26-f695-pp76
Restart Required: Yes
Instructions:
1. Update @cyanheads/git-mcp-server to version 2.1.5 or later using npm update @cyanheads/git-mcp-server. 2. Restart the MCP server process. 3. Verify the update with npm list @cyanheads/git-mcp-server.
🔧 Temporary Workarounds
Input Validation and Sanitization
allImplement strict input validation to reject shell metacharacters in user inputs.
Implement regex filtering for shell metacharacters (|, >, &, ;, $, etc.) in server code.
Use child_process.execFile Instead
allReplace child_process.exec with child_process.execFile to avoid shell interpretation.
Modify server code to use execFile with explicit arguments instead of exec with concatenated strings.
🧯 If You Can't Patch
- Isolate the server in a restricted network segment with minimal privileges.
- Implement application-level firewalls or WAF rules to block suspicious command patterns.
🔍 How to Verify
Check if Vulnerable:
Check the installed version of @cyanheads/git-mcp-server; if it's below 2.1.5, it's vulnerable.
Check Version:
npm list @cyanheads/git-mcp-server | grep @cyanheads/git-mcp-server
Verify Fix Applied:
Confirm the version is 2.1.5 or higher and test that shell metacharacters in inputs no longer execute commands.
📡 Detection & Monitoring
Log Indicators:
- Unusual shell commands in server logs, unexpected process spawns, or errors from invalid command syntax.
Network Indicators:
- Anomalous outbound connections from the server process to unknown IPs.
SIEM Query:
process.name:node AND cmdline:*child_process.exec* AND cmdline:*git* AND (cmdline:*|* OR cmdline:*>* OR cmdline:*&*)