{"id":2584,"cve":"CVE-2026-77932","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-77932\/","cwe":"CWE-306","cwe_number":306,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/306","cvss_score":9.3,"published":"2026-10-20","owasp":"A01 Broken Access Control","odc":"Interface","cdc":"Missing Check","category":"Authentication, Authorization, and Session Management","subcategory":"Privilege Escalation","scope":"Remote","impact":"Arbitrary Code Execution","summary":"Unauthenticated RCE via \/api\/v1\/chat\/react-agent: admin role grants root code execution.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-77932\/","description":"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.","solution":"Upgrade DB\u2011GPT to version\u202f0.8.3 or later, which removes the insecure mock\u202fget_user_from_headers implementation and disables the unsandboxed\u202fcode_interpreter\u202fand\u202fshell_interpreter\u202ftools for untrusted users.","affected_component":"DB-GPT","fixed_by_upgrading":false,"vulnerable_code":"from flask import Flask, request, jsonify\n\napp = Flask(__name__)\n\n# Mock function that erroneously grants admin to everyone\ndef get_user_from_headers(headers):\n    # VULNERABLE: always returns admin role\n    return {\"username\": \"anonymous\", \"role\": \"admin\"}\n\n@app.route(\"\/api\/v1\/chat\/react-agent\", methods=[\"POST\"])\ndef react_agent():\n    user = get_user_from_headers(request.headers)\n    if user[\"role\"] != \"admin\":\n        return jsonify({\"error\": \"Forbidden\"}), 403\n\n    # Unsandboxed tool execution\n    from react_agent import ReActAgent\n    agent = ReActAgent()\n    result = agent.run(request.json.get(\"prompt\", \"\"))\n    return jsonify({\"response\": result})\n","patched_code":"from flask import Flask, request, jsonify\n\napp = Flask(__name__)\n\n# Proper authentication: verify token and lookup role\ndef get_user_from_headers(headers):\n    # FIX: validate token and assign correct role\n    token = headers.get(\"Authorization\", \"\").replace(\"Bearer \", \"\")\n    if token == \"secret-admin-token\":\n        return {\"username\": \"admin\", \"role\": \"admin\"}\n    elif token == \"secret-user-token\":\n        return {\"username\": \"user\", \"role\": \"user\"}\n    return None\n\n@app.route(\"\/api\/v1\/chat\/react-agent\", methods=[\"POST\"])\ndef react_agent():\n    user = get_user_from_headers(request.headers)\n    if not user or user[\"role\"] != \"admin\":\n        return jsonify({\"error\": \"Forbidden\"}), 403\n\n    # Unsandboxed tool execution\n    from react_agent import ReActAgent\n    agent = ReActAgent()\n    result = agent.run(request.json.get(\"prompt\", \"\"))\n    return jsonify({\"response\": result})\n","payload_needed":true,"payload":null,"payload_status":"model_refused","published_fix":[],"references":null}