VAITP Dataset

← Back to the dataset

CVE-2026-77932

Unauthenticated RCE via /api/v1/chat/react-agent: admin role grants root code execution.

  • CVSS 9.3
  • CWE-306
  • Authentication, Authorization, and Session Management
  • Remote

DB-GPT through 0.8.2 contains an unauthenticated remote code execution vulnerability because the /api/v1/chat/react-agent endpoint relies on a mock get_user_from_headers function that grants every caller the admin role. Unauthenticated attackers can send prompts that make the ReAct agent's unsandboxed code_interpreter and shell_interpreter tools run arbitrary Python or bash as root in the webserver container, including reaching the bundled database with default credentials.

CVSS base score
9.3
Published
2026-10-20
OWASP
A01 Broken Access Control
Orthogonal defect classification
Interface
Code defect classification
Missing Check
Category
Authentication, Authorization, and Session Management
Subcategory
Privilege Escalation
Accessibility scope
Remote
Impact
Arbitrary Code Execution
Affected component
DB-GPT

Solution

Upgrade DB‑GPT to version 0.8.3 or later, which removes the insecure mock get_user_from_headers implementation and disables the unsandboxed code_interpreter and shell_interpreter tools for untrusted users.

Vulnerable code sample

from flask import Flask, request, jsonify

app = Flask(__name__)

# Mock function that erroneously grants admin to everyone
def get_user_from_headers(headers):
    # VULNERABLE: always returns admin role
    return {"username": "anonymous", "role": "admin"}

@app.route("/api/v1/chat/react-agent", methods=["POST"])
def react_agent():
    user = get_user_from_headers(request.headers)
    if user["role"] != "admin":
        return jsonify({"error": "Forbidden"}), 403

    # Unsandboxed tool execution
    from react_agent import ReActAgent
    agent = ReActAgent()
    result = agent.run(request.json.get("prompt", ""))
    return jsonify({"response": result})

Patched code sample

from flask import Flask, request, jsonify

app = Flask(__name__)

# Proper authentication: verify token and lookup role
def get_user_from_headers(headers):
    # FIX: validate token and assign correct role
    token = headers.get("Authorization", "").replace("Bearer ", "")
    if token == "secret-admin-token":
        return {"username": "admin", "role": "admin"}
    elif token == "secret-user-token":
        return {"username": "user", "role": "user"}
    return None

@app.route("/api/v1/chat/react-agent", methods=["POST"])
def react_agent():
    user = get_user_from_headers(request.headers)
    if not user or user["role"] != "admin":
        return jsonify({"error": "Forbidden"}), 403

    # Unsandboxed tool execution
    from react_agent import ReActAgent
    agent = ReActAgent()
    result = agent.run(request.json.get("prompt", ""))
    return jsonify({"response": result})

Cite this entry

@misc{vaitp:cve202677932,
  title        = {{Unauthenticated RCE via /api/v1/chat/react-agent: admin role grants root code execution.}},
  author       = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
  year         = {2026},
  note         = {VAITP Python Vulnerability Dataset, entry CVE-2026-77932},
  howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-77932/}}
}

Download this entry as JSON Download the whole dataset

Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.

The supreme art of war is to subdue the enemy without fighting.

Sun Tzu – “The Art of War”

:: Shaping the future through research and ingenuity ::

Before you use the VAITP AI models

Please read and accept the following disclaimer:

By choosing "I understand and accept", you acknowledge that you understand and agree to these terms.