GHSA-6HH9-GV48-G8Q6
Persistent startup crash (DoS) via malformed webpush subscription keys — no key material validation before pywebpush construction
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:L/PR:L/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-6HH9-GV48-G8Q6 divulgada · CVSS 6.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Summary
The webpush subscription validator (_validate_subscription,
frigate/api/notification.py:104-109) only checks that the p256dh and
auth key fields are non-empty strings. It does not validate that they
are well-formed key material. pywebpush's WebPusher constructor
base64-decodes p256dh and requires it to be exactly a 65-byte
uncompressed EC point starting with \x04, raising WebPushException
if not. WebPushClient constructs one WebPusher per stored subscription
for every user, unguarded, and this construction happens inside
init_dispatcher() during application startup with no exception
handling around individual subscriptions.
Details
Any authenticated user, including restricted/viewer-role accounts,
can register a subscription with a syntactically valid-looking but
cryptographically malformed p256dh value. This is accepted and
persisted by the registration endpoint (only presence/type is checked,
not decodability or byte length/format), but causes an unhandled
exception the next time the server constructs the WebPushClient —
which happens on every startup, including automatic restarts after a
crash. This creates a persistent crash loop: the poisoned subscription
is loaded from SQLite on every boot, WebPusher construction fails
immediately, and the process exits before completing initialization
of the API, UI, and dispatcher.
Chain: WebPusher.__init__ (pywebpush, raises on malformed key) →
WebPushClient.__init__ (webpush.py:81-87, constructs one WebPusher
per stored token, unguarded) → comms.append(...) → start()
(app.py:591, unguarded) → init_dispatcher() (app.py:326) → process
exit → container restart reloads the same poisoned
notification_tokens table from SQLite → crash repeats indefinitely.
Test coverage gap:
test_webpush_registration.py::test_rejects_incomplete_keys checks
only presence, non-emptiness, and type of the key strings. It never
decodes the key material and never exercises actual WebPusher
construction. The existing test suite passes cleanly while this crash
chain remains fully reachable.
PoC
Live-tested registration step (steps 6-7 of the same test run as
Finding 1):
Step 6 — malformed key accepted and persisted:
POST /notifications/register
{"sub": {"endpoint": "https://fcm.googleapis.com/fcm/send/x",
"keys": {"p256dh": "!!!not-base64!!!", "auth": "YXV0aC1zZWNyZXQ"}}}
-> 200 {"success": true, "message": "Successfully saved token."}
Step 7 — confirmed WebPusher construction fails on this exact stored
value:
WebPusher.__init__ raised -> WebPushException: Invalid p256dh key
specified
Note on verification scope: the registration-time acceptance (step 6)
and the WebPusher construction failure on the resulting stored value
(step 7) were both directly verified. The full crash-loop chain
through app.py's unguarded startup call stack was verified by direct
code inspection of the unguarded call path
(WebPushClient.__init__ → start() → init_dispatcher()) rather than
exercised against a live docker-compose deployment restart cycle —
noted here explicitly per responsible disclosure of verification depth.
### Impact
Any authenticated account, including restricted/viewer-role users,
can permanently break Frigate's startup process (UI, API,
notifications, and dispatcher all fail to initialize) on any
installation with camera notifications enabled, by registering a
single malformed subscription. The same technique can pre-poison
installations where notifications are not yet enabled, so the crash
manifests later when the feature is turned on. Recovery requires
manual SQLite database editing, since the API provides no mechanism
for an administrator to list or delete other users' stored
subscription tokens.
### Suggested Fix
Validate key material in _validate_subscription before persisting:
base64-decode p256dh and require exactly 65 bytes with a leading
\x04 byte; base64-decode auth and require at least 16 bytes.
Additionally, wrap per-user WebPusher construction in a try/except
that quarantines individually malformed subscriptions (logging and
skipping them) rather than allowing one bad row to abort the entire
startup sequence. Add an admin-facing endpoint to list and delete
stored subscription tokens for recovery without direct database access.
Please credit this report to Mayssare Amakhtari (GitHub: @cy3erm).
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 |
Sin parche | — | — | 0.7.0 afectada |
0.18.0Arsenal 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-6hh9-gv48-g8q6Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
