GHSA-H7QP-3PMH-JHMX
GET /sub_labels and GET /labels disclose face-recognition/LPR data and generic object labels from cameras outside the caller's role-scoped access
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-H7QP-3PMH-JHMX divulgada · CVSS 4.3 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Vulnerability Details
Files: `frigate/api/app.py` — `GET /sub_labels` (line 619), `GET /labels` (line 601)
CWE: CWE-862 — Missing Authorization
Root Cause
Two adjacent read endpoints in `frigate/api/app.py` query the `Event` table with **no camera
filter at all**, and are gated only by `allow_any_authenticated()` — the loosest auth gate in
the app, satisfied by any logged-in user regardless of role or `auth.roles` camera restriction:
# frigate/api/app.py:619-629 -- GET /sub_labels
@router.get("/sub_labels", dependencies=[Depends(allow_any_authenticated())])
def get_sub_labels(split_joined: Optional[int] = None):
events = Event.select(Event.sub_label).distinct() # no camera filter
...
# frigate/api/app.py:601-616 -- GET /labels
@router.get("/labels", dependencies=[Depends(allow_any_authenticated())])
def get_labels(camera: str = ""):
if camera:
events = Event.select(Event.label).where(Event.camera == camera).distinct() # `camera`
else: # never
events = Event.select(Event.label).distinct() # checked
... # against
# caller`Event.sub_label` is populated by Frigate's own recognition features with genuinely sensitive,
person-identifying data:
- Face recognition writes the recognized person's name (`frigate/data_processing/real_time/face.py`,
`sub_label, score = self.recognizer.classify(face)` → `frigate/track/object_processing.py:385`,
`event.sub_label = sub_label`).
- License-plate recognition writes the recognized plate string
(`frigate/data_processing/post/license_plate.py`).
This is the same class of data the `/faces/*` management endpoints and `/lpr/reprocess`
correctly require `admin` role to touch — but `/sub_labels` exposes the *output* of that same
recognition pipeline to any authenticated user, system-wide, unscoped.
Sibling endpoints elsewhere in this codebase correctly filter by the caller's permitted cameras
via `Depends(get_allowed_cameras_for_filter)` (e.g. `frigate/api/media.py`, `frigate/api/event.py`).
Neither `get_sub_labels()` nor `get_labels()` has this dependency — the same "protected sibling,
unprotected twin" pattern found elsewhere in this codebase (e.g. the already-disclosed
GHSA-f4g2-5496-9233 face-management path-traversal pair, and GHSA-2vw5-qcf8-4jm6's GenAI review
summary leak).
Attack Scenario
Prerequisites: `auth.enabled: true`, at least one custom role scoped to fewer than all cameras
(a normal Frigate deployment pattern — household members each get a camera-scoped account),
face recognition and/or LPR enabled.
- Attacker holds valid credentials for a low-privilege custom role scoped to exactly one
- `GET /sub_labels` with the attacker's own valid session returns every recognized face name
- `GET /labels?camera=bedroom` similarly answers with the generic object classes (e.g.
### Impact
- Who is affected: Any deployment using per-camera custom roles together with face
recognition and/or license-plate recognition (the primary use case those features and custom
roles both exist for).
- What attacker achieves: `/sub_labels` — enumerates PII (names, license plates) tied to
activity on cameras outside the caller's authorization; a genuine privacy/confidentiality
violation. `/labels` — lower-sensitivity activity-pattern inference (which generic object
classes were seen on an unauthorized camera), filed alongside for completeness since it shares
the identical missing-dependency root cause and fix.
- Conditions required: Any authenticated account, including the most restricted custom role.
### Vulnerable Code
See above.
Recommended Fix
@router.get("/sub_labels", dependencies=[Depends(allow_any_authenticated())])
def get_sub_labels(
split_joined: Optional[int] = None,
allowed_cameras: List[str] = Depends(get_allowed_cameras_for_filter),
):
query = Event.select(Event.sub_label).distinct()
if allowed_cameras:
query = query.where(Event.camera.in_(allowed_cameras))
events = query
...
@router.get("/labels", dependencies=[Depends(allow_any_authenticated())])
def get_labels(
camera: str = "",
allowed_cameras: List[str] = Depends(get_allowed_cameras_for_filter),
):
if camera and allowed_cameras and camera not in allowed_cameras:
return JSONResponse(content=[], status_code=403)
...Reusing the same `get_allowed_cameras_for_filter` dependency already used correctly by sibling
endpoints closes both sinks with one consistent pattern.
Verification
Dynamically confirmed via real-code-import pytest driving the actual FastAPI routes through
`TestClient` against the real ASGI app (`frigate/test/http_api/test_sub_labels_labels_cross_camera_leak.py`,
3/3 pass, not a hand-copied reimplementation):
- Two configured cameras (`front_door` in-scope for a `neighbor` role, `master_bedroom`
out-of-scope), with real `Event` rows inserted per camera.
- `GET /sub_labels` as the `neighbor`-role caller (headers reproducing exactly what nginx sets
post-`/auth`) returned `["Alice Smith", "BEDROOM_PLATE_XYZ999_UNAUTHORIZED"]` — the
bedroom-only marker leaked to a front_door-scoped caller.
- `GET /labels?camera=master_bedroom` as the same caller returned `["car"]` — data for a camera
outside the caller's permitted set, unfiltered.
- A signature-inspection control confirmed neither route function carries an
`allowed_cameras`/camera-scoping dependency, ruling out a test-harness artifact.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
pypifrigate |
Sin parche | — | — | 0.7.0 afectada |
Arsenal 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-h7qp-3pmh-jhmxLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
