Summary
A critical OS command injection vulnerability in Frigate's go2rtc integration allows arbitrary system commands to be executed via unsanitized values in config.yaml using the exec: directive.
In environments where an attacker has administrative access or where the Frigate instance is exposed to the internet without authentication, this flaw can be used to gain full remote command execution on the host system.
Affected context
The vulnerability occurs in Frigate deployments that integrate with go2rtc and accept dynamic video stream configuration through config.yaml.
It is relevant when:
- The
exec:directive is available in the go2rtc stream configuration - Values from
config.yamlare passed to the underlying system command layer without sanitization or restriction - Administrative users (or anyone, if exposed without auth) can modify stream configuration
The issue is particularly risky for self-hosted or containerized Frigate setups where the service account has broad system or Docker host privileges.
Exploit preconditions
- Attack surface: Frigate/go2rtc configuration interface (
config.yaml), typically via the web UI, API, or direct file access. - Required access:
- Administrative access to Frigate, OR
- Unauthenticated access if the installation is exposed publicly with no access controls, effectively granting administrative capabilities.
- Trigger point: The go2rtc service processes the video stream configuration and executes commands specified with the
exec:directive. - Why exploitation is possible: User-controlled data from
config.yamlis trusted and passed into command execution without validation, escaping, or restriction, allowing arbitrary shell commands to be injected and run by the go2rtc process under its current privileges.
Why this happens
The root cause is an OS command injection flaw where configuration values are treated as trusted command content.
Frigate's integration with go2rtc allows stream definitions to include an exec: directive, which is passed to the operating system for execution without sanitization, validation, or proper separation of data from control.
This corresponds to CWE-78: Improper Neutralization of Special Elements used in an OS Command, combined with excessive trust in administrative configuration paths (CWE-250/CWE-269/CWE-668).
Conceptually, the design assumes that configuration input is inherently safe, resulting in a pattern where configuration fields directly control executable command strings.
Potential impact
- Full remote execution of arbitrary OS commands under the privileges of the Frigate/go2rtc process
- Installation of malware, backdoors, or persistence mechanisms on the host
- Exfiltration of sensitive data from the host system or connected storage
- Pivoting to other internal services or infrastructure reachable from the Frigate host
- Manipulation or destruction of recorded video evidence and configuration data
- Abuse of host resources for tasks such as cryptomining or launching further attacks
General mitigation guidance
Mitigation focuses on breaking the direct link between user-controlled configuration and unrestricted command execution.
Recommended patterns include:
- Constrain execution paths: Replace generic
exec:-driven command invocation with predefined, parameterized actions that map configuration options to a small, fixed set of safe operations. - Eliminate inline shell composition: Avoid constructing shell command strings from configuration values; instead use APIs or structured argument lists that do not invoke a shell.
- Validate and normalize configuration: Apply strict schema validation to configuration fields, rejecting values that contain shell metacharacters or that deviate from expected patterns (e.g., URLs, file paths, or enumerated options only).
- Apply least-privilege: Run Frigate/go2rtc processes under a dedicated, minimally privileged account with limited filesystem and network access, reducing the blast radius if an injection occurs.
- Harden access control: Require authentication for administrative operations and avoid exposing configuration management interfaces directly to the internet.
- Segregate sensitive capabilities: Place components that must perform system-level actions behind internal, well-defined interfaces rather than giving configuration the ability to call arbitrary commands.
How teams detect issues like this
Detection typically involves inspecting both configuration handling and runtime behavior.
Potential strategies:
- Static analysis and code scanning:
- Flag patterns where configuration values are passed directly into command execution functions or shell invocations.
- Define rules for unsafe use of APIs that spawn processes (e.g., calls that accept raw strings instead of argument arrays).
- Configuration review and policy checks:
- Enforce policies that prevent use of arbitrary
exec:directives or limit them to vetted patterns. - Use CI/CD hooks to validate
config.yamlagainst a security-focused schema before deployment. - Runtime monitoring:
- Monitor for unusual child processes spawned by the Frigate/go2rtc service.
- Track command-line arguments for unexpected executables or shell metacharacters originating from configuration-controlled paths.
- Log analysis:
- Centralize and parse application and system logs for anomalous command executions or configuration changes related to stream definitions.
Automated SAST/IAST tools and configuration scanners can assist by highlighting direct command execution driven by user-configurable values and by enforcing organization-specific security rules around configuration files.

