{"id":1986,"cve":"CVE-2026-49257","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-49257\/","cwe":"CWE-306","cwe_number":306,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/306","cvss_score":10,"published":"2026-06-18","owasp":"A01 Broken Access Control","odc":"Checking","cdc":"Missing Check","category":"Authentication, Authorization, and Session Management","subcategory":"Server-Side Request Forgery (SSRF)","scope":"Remote","impact":"Privilege Escalation","summary":"mcp-pinot's insecure default allows full read\/write access to Pinot.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-49257\/","description":"mcp-pinot is a Python-based Model Context Protocol (MCP) server for interacting with Apache Pinot. In versions 3.0.1 and below, mcp-pinot defaults to running an HTTP MCP server bound to 0.0.0.0:8080 with no authentication enabled. All MCP tools, including SQL query execution, schema creation, and table-config mutation, are reachable by any network-adjacent caller. The server proxies these calls using server-side Pinot credentials, producing a confused-deputy condition that yields full read\/write access to the configured Pinot cluster. This issue has been fixed in version 3.1.0","solution":"Upgrade to mcp-pinot version 3.1.0.","affected_component":"mcp-pinot","fixed_by_upgrading":true,"vulnerable_code":"import os\nfrom flask import Flask, request, jsonify\n\n# In a real application, these credentials would be loaded from a secure\n# configuration or environment variables and used to connect to Pinot.\n# This simulates the server having privileged access.\nPINOT_CONTROLLER = os.getenv(\"PINOT_CONTROLLER\", \"http:\/\/localhost:9000\")\nPINOT_AUTH_TOKEN = os.getenv(\"PINOT_AUTH_TOKEN\", \"server-secret-admin-token\")\n\napp = Flask(__name__)\n\ndef execute_proxied_pinot_query(sql_query):\n    \"\"\"\n    Simulates the server using its own credentials to execute a query\n    on the backend Pinot cluster. This is the \"confused deputy\".\n    \"\"\"\n    print(f\"Proxying query to Pinot controller: {PINOT_CONTROLLER}\")\n    print(f\"Using server's internal auth token to execute: {sql_query}\")\n    # In a real implementation, this would use a library like 'requests'\n    # to send the query to the Pinot controller with the auth token.\n    # e.g., requests.post(..., headers={'Authorization': f'Bearer {PINOT_AUTH_TOKEN}'})\n    return {\"result\": f\"successfully executed '{sql_query}'\", \"node\": \"pinot-broker-1\"}\n\n@app.route('\/mcp\/sql', methods=['POST'])\ndef handle_sql_query():\n    \"\"\"\n    An open endpoint that accepts a SQL query and executes it.\n    No authentication or authorization is performed on the incoming request.\n    \"\"\"\n    data = request.get_json()\n    if not data or 'query' not in data:\n        return jsonify({\"error\": \"Missing 'query' in request body\"}), 400\n\n    query = data['query']\n    \n    # The server executes the user-provided query with its own privileges.\n    result = execute_proxied_pinot_query(query)\n    \n    return jsonify(result)\n\nif __name__ == '__main__':\n    # The server defaults to binding on 0.0.0.0, making it accessible\n    # to any network-adjacent caller.\n    # The default port is 8080.\n    # No authentication is configured for the Flask app.\n    app.run(host='0.0.0.0', port=8080)","patched_code":"import click\n\n# This code represents the fix for the vulnerability described.\n# The original vulnerable code defaulted the 'host' parameter to '0.0.0.0',\n# which binds the server to all network interfaces, making it accessible\n# to any network-adjacent caller.\n#\n# The fix, shown below, is to change the default value for 'host' to\n# '127.0.0.1'. This ensures that by default, the server only binds to the\n# localhost interface and is not exposed to the network, mitigating the\n# \"confused-deputy\" vulnerability. The user must now explicitly set\n# --host 0.0.0.0 to achieve the previous, less secure behavior.\n\n@click.command()\n@click.option(\n    \"--host\",\n    # This default value is the fix. It was previously \"0.0.0.0\".\n    default=\"127.0.0.1\",\n    show_default=True,\n    help=\"The host on which to run the server.\",\n)\n@click.option(\n    \"--port\",\n    default=8080,\n    show_default=True,\n    help=\"The port on which to run the server.\",\n)\ndef serve(host, port):\n    \"\"\"\n    A simplified representation of the mcp-pinot server startup command.\n    The key change is the default value for the '--host' option.\n    \"\"\"\n    print(f\"Starting server on http:\/\/{host}:{port}...\")\n\n    if host == \"127.0.0.1\":\n        print(\"FIX APPLIED: Server is correctly bound to localhost by default.\")\n    elif host == \"0.0.0.0\":\n        print(\"WARNING: Server is bound to all interfaces and is network-accessible.\")\n\n    # In the actual application, this function would proceed to start\n    # a web server (e.g., using wsgiref.simple_server) with the provided\n    # host and port.\n    #\n    # from wsgiref.simple_server import make_server, demo_app\n    # with make_server(host, port, demo_app) as httpd:\n    #     httpd.serve_forever()\n\nif __name__ == '__main__':\n    # Running the script without arguments uses the new, secure default.\n    # > python your_script_name.py\n    # Output:\n    # Starting server on http:\/\/127.0.0.1:8080...\n    # FIX APPLIED: Server is correctly bound to localhost by default.\n    serve()","payload_needed":true,"payload":"```bash\ncurl -X POST http:\/\/VULNERABLE_HOST:8080\/query\/sql \\\n-H \"Content-Type: application\/json\" \\\n-d '{\"sql\": \"SELECT tableName FROM \\\"pinot_server_tables\\\"\"}'\n```","payload_status":"available","published_fix":[{"repository":"startreedata\/mcp-pinot","commit_url":"https:\/\/github.com\/startreedata\/mcp-pinot\/commit\/1c7d3f9cd384854bf72c127d230bdb32299475ad","commit_subject":"[codex] fix read-query exposure safeguards (#95)","units":[{"file":"mcp_pinot\/config.py","function":null},{"file":"mcp_pinot\/config.py","function":"load_server_config"},{"file":"mcp_pinot\/pinot_client.py","function":null},{"file":"mcp_pinot\/pinot_client.py","function":"PinotClient.execute_query"},{"file":"mcp_pinot\/pinot_client.py","function":"PinotClient._extract_sql_table_names"},{"file":"mcp_pinot\/prompts.py","function":null},{"file":"mcp_pinot\/server.py","function":null},{"file":"mcp_pinot\/server.py","function":"main"},{"file":"mcp_pinot\/server.py","function":"read_query"}]}],"references":null}