llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · frigate

GHSA-R57J-5JM9-HPCC

Incomplete patch of CVE-2026-25643: go2rtc exec:/echo:/expr: prefix block is bypassed when a stream value is a YAML mapping with a `url` key (RCE + container escape)

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
9.1
Crítica
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición145 dDesde la divulgación, 28 jun 2026, 7:15 a. m.
Detección143 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada +1
Explotación
Remediación
Monitoreo
Detectada +1
28 jun 26
18 nov 26
21 nov 26
28 jun 26
3 ago 26
9 sept 26
15 oct 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-R57J-5JM9-HPCC divulgada · CVSS 9.1 (GitHub)
Divulgación Modificada Última actualización del registro
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Affected

  • `blakeblackshear/frigate` <= v0.17.1 (latest release as of 2026-06-16) and current `dev` HEAD.
  • File: `docker/main/rootfs/usr/local/go2rtc/create_config.py`, the `for name in list(go2rtc_config.get('streams', {})):` loop.

Summary

The "Restrict go2rtc exec sources by default" mitigation introduced in PR #21543 (commit c8f55ac4, shipped in v0.16.4 and re-released as part of v0.17.0/0.17.1) is the published fix for CVE-2026-25643 / GHSA-4c97-5jmr-8f6x (RCE + container escape via go2rtc `exec:` source). The patch filters out any `streams.<name>` whose value is a `str` or `list[str]` beginning with `echo:`, `expr:`, or `exec:`. It does not handle the case where the stream value is a YAML mapping (Python `dict`), even though go2rtc's own `NewStream(map[string]any)` handler explicitly accepts that shape and forwards `source["url"]` straight to the underlying scheme dispatcher — including `exec:`, which runs an attacker-controlled command in the privileged Frigate container.

Threat model

Identical to the original CVE-2026-25643 (admin authenticated, exposes RCE in a typically-`--privileged` container → host-level container escape per the original GHSA-4c97-5jmr-8f6x PoCs):

> "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."

Frigate deployments use `--privileged` for GPU access, so the RCE is also a container escape (mount of host EFI partition, exfiltration of `FRIGATE_*` secrets) exactly as demonstrated in the original advisory.

Root cause

Master HEAD `create_config.py` (lines 98-145):

for name in list(go2rtc_config.get("streams", {})):
    stream = go2rtc_config["streams"][name]

    if isinstance(stream, str):
        # apply is_restricted_go2rtc_source
        ...
    elif isinstance(stream, list):
        # apply is_restricted_go2rtc_source to each item
        ...
    # No isinstance(stream, dict) branch.

`is_restricted_go2rtc_source(s)` only inspects a string and only handles literal `echo:`, `expr:`, `exec:` prefixes. The patched loop only invokes it for `str` and `list[str]` shapes. Anything that is neither is written through to `/dev/shm/go2rtc.yaml` unchanged.

Frigate's `RestreamConfig` model (`frigate/config/config.py:244-245`) is `BaseModel` + `ConfigDict(extra="allow")` with zero declared fields, so the pydantic layer at `PUT /api/config/set` performs no schema-level rejection of dict-typed stream values.

go2rtc v1.9.13 (pinned in `docker/main/Dockerfile:66`) defines, in `internal/streams/stream.go` lines 18-49:

func NewStream(source any) *Stream {
    switch source := source.(type) {
    ...
    case map[string]any:
        return NewStream(source["url"])
    ...
    }
}

The recursion on `source["url"]` re-enters with the unwrapped string and dispatches through `NewProducer` → `streams.HandleFunc("exec", execHandle)` in `internal/exec/exec.go:58-117`. `execHandle` runs `exec.CommandContext(argv[0], argv[1:]...)` with no shell, but `argv[0]` is fully attacker-controlled.

Bypass payload

In the YAML config (or via `PUT /api/config/set`):

go2rtc:
  streams:
    pwn:
      url: "exec:/bin/sh -c 'id > /config/pwn.txt'"

`isinstance({"url": "exec:..."}, str)` is False and `isinstance(..., list)` is False, so neither branch of the filter runs. The dict is dumped into `/dev/shm/go2rtc.yaml` verbatim. go2rtc reads it, matches the `map[string]any` arm of `NewStream`, recurses with the inner string, and the scheme dispatcher routes it to `exec:`.

All three PoCs from the original GHSA-4c97-5jmr-8f6x (environment exfiltration, reverse shell, and host EFI partition mount → container escape) replay verbatim against this dict form, against the current latest release and master HEAD.

Static replay

Exercising the exact filter from `create_config.py` (master HEAD) against three configurations confirms the dict-form bypasses the prefix check:

=== baseline-block-string ===
  BLOCKED: 'bad' (string)
=== baseline-block-list ===
  BLOCKED: 'bad' item 1 (list)
  BLOCKED: 'bad' all items restricted
=== BYPASS-dict-url ===
  PASSTHROUGH: 'bad' is dict
  go2rtc_config['streams'] = {'bad': {'url': 'exec:/bin/sh -c id > /tmp/pwn'}}

Recommended remediation

Add a third branch to the loop:

elif isinstance(stream, dict):
    inner = stream.get("url")
    if isinstance(inner, str):
        formatted_stream = substitute_frigate_vars(inner)
        if is_restricted_go2rtc_source(formatted_stream):
            print(f"[ERROR] Stream '{name}' dict 'url' uses a restricted source ...")
            del go2rtc_config["streams"][name]
            continue
        stream["url"] = formatted_stream

A recursive walk over `go2rtc_config["streams"]` that rejects any leaf string matching the restricted prefixes (regardless of whether the parent is a `dict`, `list`, or arbitrary nested combination) is more future-proof if go2rtc adds support for additional dict shapes (e.g. backchannel options) in subsequent versions.

References

  • Original advisory: https://github.com/blakeblackshear/frigate/security/advisories/GHSA-4c97-5jmr-8f6x
  • CVE-2026-25643
  • Mitigation PR: https://github.com/blakeblackshear/frigate/pull/21543
  • Mitigation commit: c8f55ac41f050853a62243583a5271f5293447e5
  • go2rtc NewStream: https://github.com/AlexxIT/go2rtc/blob/v1.9.13/internal/streams/stream.go#L18-L49
  • go2rtc exec handler: https://github.com/AlexxIT/go2rtc/blob/v1.9.13/internal/exec/exec.go#L58-L117

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:H
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:C
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
7.3/ 10Alto
Vector 7.3 (fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
frigate≤ 0.17.1
0.7.0
0.17.1
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
pypifrigate
Sin parche — — 0.7.0 afectada
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/blakeblackshear/frigate/security/advisories/GHSA-r57j-5jm9-hpcc

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.