GHSA-PJJX-9F4V-F8JX
Zero-area face detection crashes the shared, unsupervised EmbeddingMaintainer thread, silently disabling face recognition/LPR/semantic-search/GenAI-description for ALL cameras
Texto original en inglés · Ver en español
CVSS:3.1/AV:A/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-PJJX-9F4V-F8JX divulgada · CVSS 4.2 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Vulnerability Details
File: `frigate/data_processing/real_time/face.py` (root cause), `frigate/embeddings/maintainer.py` (unsupervised call site)
CWE: CWE-1284 (Improper Validation of Specified Quantity in Input), CWE-248 (Uncaught Exception)
Root Cause
`FaceRealTimeProcessor.process_frame()` (`frigate/data_processing/real_time/face.py:257-310`)
gates on a face box's RAW, unclamped area:
if (
not face_box
or area(face_box) < self.config.cameras[camera].face_recognition.min_area
):
return
face_frame = face_frame[
max(0, face_box[1]) : min(frame.shape[0], face_box[3]),
max(0, face_box[0]) : min(frame.shape[1], face_box[2]),
]
...
self.person_face_history[id].append(
(sub_label, score, face_frame.shape[0] * face_frame.shape[1])
)A detector-produced box that is nominally large (passing the raw `area()` check, computed as
`(x2-x1+1)*(y2-y1+1)` with no reference to actual frame bounds) but positioned mostly/entirely
outside the frame clamps to an EMPTY crop — `face_frame.shape[0] * face_frame.shape[1]` can be
exactly `0` even though the check that was supposed to filter this out already passed.
That `face_area = 0` reaches `weighted_average()` (`frigate/data_processing/real_time/face.py:462-516`):
for name, score, face_area in results_list:
...
weight = min(face_area, max_weight) # 0 if face_area == 0
weight *= (score - self.face_config.unknown_score) * 10
weighted_scores[name] += score * weight
total_weights[name] += weight # can sum to exactly 0.0
...
best_name = max(weighted_scores, key=weighted_scores.get)
if counts[best_name] < self.face_config.min_faces: # default min_faces = 1
return None, 0.0
...
weighted_average = weighted_scores[best_name] / total_weights[best_name] # ZeroDivisionError, uncaughtWith `min_faces` defaulting to `1`, a single degenerate detection is sufficient to reach the
unguarded division.
Blast Radius (why this matters more than a typical uncaught exception)
`process_frame()` is called from `EmbeddingMaintainer._process_frame_updates()`
(`frigate/embeddings/maintainer.py:449`), with no surrounding try/except (the only try/except in
that function guards an unrelated `FileNotFoundError` on frame lookup), inside
`EmbeddingMaintainer.run()`'s main loop. `EmbeddingMaintainer` is a `threading.Thread`
(`class EmbeddingMaintainer(threading.Thread):`, line 75) — not a supervised
`multiprocessing.Process`. An uncaught exception inside a Python thread's `run()` silently kills
only that thread; nothing restarts it. Confirmed via code search: neither `frigate/watchdog.py`
(which only tracks `detectors: dict[str, ObjectDetectProcess]`) nor `frigate/app.py` references
`EmbeddingMaintainer`/`embeddings_maintainer` in any supervision or restart context.
`EmbeddingMaintainer` is the SINGLE SHARED thread handling face recognition, license plate
recognition, semantic search (`/events/search`, `/events/explore`), embedding-based triggers,
and GenAI review-description generation for every configured camera. One degenerate
detection on any single camera permanently and silently disables ALL of these features
system-wide (not just for that camera) until a full manual Frigate restart.
Attack Scenario
Prerequisites: face recognition enabled. A detector (misbehaving hardware plugin, adversarial or
corrupted model input, or a misconfigured model producing badly-scaled coordinates) emits a
face-box detection positioned mostly/fully outside the actual camera frame, with large nominal
(pre-clamp) dimensions.
- `area(face_box) >= min_area` passes (raw box area is large).
- The clamped crop is empty -> `face_area = 0` recorded in `person_face_history`.
- `weighted_average()` is called with this single zero-area entry (`min_faces=1` needs no more).
- `ZeroDivisionError`, uncaught, kills the `EmbeddingMaintainer` thread.
- Face recognition, LPR, semantic search, and GenAI descriptions silently stop working for
Impact
Every camera/user on the instance is affected (single shared thread, not per-camera) - broader
blast radius than the previously-reported detection-pipeline crash findings
(GHSA-g7v4-mvcq-6pgp, GHSA-6hj4-39pc-323x) which are scoped to one camera or are auto-recovered
by `FrigateWatchdog` respectively. This finding's affected component (`EmbeddingMaintainer`,
a thread) has no equivalent supervision at all.
Recommended Fix
- Fix the `min_area` check to test the actual post-clamp crop area, not the raw box area:
clamped_area = max(0, min(frame.shape[0], face_box[3]) - max(0, face_box[1])) * \
max(0, min(frame.shape[1], face_box[2]) - max(0, face_box[0]))
if not face_box or clamped_area < self.config.cameras[camera].face_recognition.min_area:
return- Guard the division in `weighted_average()` regardless (defense in depth):
if total_weights[best_name] <= 0:
return None, 0.0
weighted_average = weighted_scores[best_name] / total_weights[best_name]3. Architecturally: wrap `EmbeddingMaintainer.run()`'s per-iteration work in a try/except that
logs and continues rather than letting any single processor's exception kill the whole thread.
Verification
Dynamically confirmed via a real-code-import reproduction calling the actual, unmodified
`FaceRealTimeProcessor.weighted_average()`:
import frigate.embeddings # forces correct module init order
from frigate.data_processing.real_time.face import FaceRealTimeProcessor
import types
proc = object.__new__(FaceRealTimeProcessor)
proc.face_config = types.SimpleNamespace(unknown_score=0.8, min_faces=1)
results_list = [('alice', 0.95, 0)]
proc.weighted_average(results_list)Result: `ZeroDivisionError: float division by zero`, reproducible deterministically. Blast-radius
claim (unsupervised thread) independently confirmed via code search of `watchdog.py`/`app.py`
showing no reference to `EmbeddingMaintainer` in any restart/supervision path.
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-pjjx-9f4v-f8jxLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
