GHSA-74FJ-G666-3RV9
Custom-role users can brute-force any account's password via /users/{username}/password (no rate limit)
Texto original en inglés · Ver en español
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-74FJ-G666-3RV9 divulgada · CVSS 7.5 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Vulnerability Details
File: `frigate/api/auth.py`
Function/Route: `PUT /users/{username}/password` (`update_password()`, ~line 861)
CWE: CWE-863 — Incorrect Authorization, chained with CWE-307 — Improper Restriction of Excessive Authentication Attempts
Relationship to prior advisories on this endpoint
This is a residual gap in the fix for GHSA-24p8-r573-vwr2 (CVE-2026-33124, "Insecure password
change functionality"), not a duplicate of it. That advisory covered the *complete absence* of an
`old_password` check for self password changes; the fix correctly added that check, plus an
ownership restriction so non-admins can't target other accounts. This report covers a mechanism
that fix introduced: the ownership restriction only excludes the literal role string `"viewer"`,
not Frigate's custom-role system, and no rate limiting was added to the endpoint at all.
(`DELETE /users/{username}` from the unrelated GHSA-vg28-83rp-8xx4 is also not implicated — that
endpoint already correctly requires `Depends(require_role(["admin"]))` in the current code.)
Root Cause
# frigate/api/auth.py
@router.put(
"/users/{username}/password",
dependencies=[Depends(allow_any_authenticated())], # any role, not admin-only
...
)
async def update_password(request: Request, username: str, body: AppPutPasswordBody):
current_user = await get_current_user(request)
current_username = current_user.get("username")
current_role = current_user.get("role")
# viewers can only change their own password
if current_role == "viewer" and current_username != username:
raise HTTPException(status_code=403, detail="Viewers can only update their own password")
...
user = User.get_by_id(username) # target account, from the URL
if current_role != "admin":
if not body.old_password:
return JSONResponse(..., status_code=400)
if not verify_password(body.old_password, user.password_hash): # the only real gate
return JSONResponse(..., status_code=401)
password_hash = hash_password(body.password, iterations=HASH_ITERATIONS)
User.update({User.password_hash: password_hash, ...}).where(User.username == username).execute()Frigate supports arbitrary custom role names (`auth.roles: Dict[str, List[str]]`, e.g. `operator`,
`neighbor` — see `frigate/config/auth.py`, and the docs' worked example under "Managing User
Roles"). The ownership check above only matches the literal string `"viewer"`. Any account whose
role is a custom name sails straight past it when `username` in the URL names a *different*
account — the docstring's stated invariant ("Users can only change their own password unless
they have admin role") is not actually enforced for that entire class of users.
The code then falls through to require `body.old_password` to match the target account's
current password hash. `verify_password()` (PBKDF2-SHA256 + `secrets.compare_digest`) is
cryptographically sound — this is not a one-shot bypass. But `frigate/api/auth.py:740` builds
`limiter = Limiter(key_func=get_remote_addr)` with no `default_limits`, and the only
`@limiter.limit(...)` decorator in the entire file is on `POST /login` — `update_password` carries
none. Combined, this becomes an **unthrottled online password-guessing oracle against any
account**, including `admin`, reachable by the lowest-privilege authenticated role Frigate
supports. A successful guess doesn't just confirm the secret — it immediately overwrites the
target's password with a value the attacker supplied in the same request (`body.password`).
Attack Scenario
Prerequisites: `auth.enabled: true` with at least one custom role in use — a very common
deployment, since the entire purpose of custom roles is handing out camera-scoped accounts to
household members/neighbors.
- Attacker authenticates as their own low-privilege custom-role account (e.g. `neighbor`,
- Attacker sends repeated requests with no throttling:
{"old_password": "<guess>", "password": "AttackerChosenNewPassword123!"}
```
3. Every wrong guess returns `401`. Nothing rate-limits the attempt rate (contrast `/login`,
which is decorated with `@limiter.limit(limit_value=rateLimiter.get_limit)`).
4. The first guess matching `admin`'s real current password returns `200 {"success": true}` and
has already overwritten `admin`'s password with the attacker's chosen value.
5. Attacker logs in as `admin`. Full administrative takeover.
Impact
Every account, including `admin`, is reachable as a brute-force target by any other authenticated
account regardless of that account's own role or camera restrictions. Real-world impact scales
with how guessable the target's password is — a weak or reused admin password is realistically
at risk given the complete absence of throttling; a strong random password is not practically at
risk from this alone. This is a strictly worse exposure than `/login`, which the developers
correctly protected — the same secret can be attacked through a second, unthrottled door.
Recommended Fix
# Replace the role-name string comparison with a role-class check:
if current_role != "admin" and current_username != username:
raise HTTPException(status_code=403, detail="You can only update your own password")Additionally, apply the existing `/login` rate limiter to this route:
@router.put("/users/{username}/password", dependencies=[Depends(allow_any_authenticated())], ...)
@limiter.limit(limit_value=rateLimiter.get_limit)
async def update_password(request: Request, username: str, body: AppPutPasswordBody):
...Both are complementary: the authorization fix removes the ability to target other accounts at
all for non-admins; the rate limit bounds the guess rate as defense-in-depth even against a
future regression of the same class.
Verification
Dynamically confirmed via a real-code-import pytest driving the actual `update_password()` route
through FastAPI's `TestClient`, with a real `User` row and real PBKDF2 hashing
(`frigate/test/http_api/test_password_brute_force.py`, 4/4 pass):
- A wrong guess from a custom-role (`neighbor`) attacker targeting `admin` reaches the real
`verify_password()` gate (401) rather than being blocked up-front — the ownership check never
fires.
- 60 consecutive wrong guesses in a tight loop all return 401; none throttled (no 429 ever seen).
- The correct guess immediately overwrites `admin`'s password with the attacker's chosen value in
the same request — verified via `verify_password()` against the stored hash before and after.
- Differential control: the identical payload from a literal `viewer` role IS correctly rejected
with 403 up-front, and admin's password remains untouched — proving the gap is specific to
custom role names, not a blanket absence of any check.
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-74fj-g666-3rv9Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
