[Beta Support]: /api/profiles returns 403 for non-admin users — missing from EXEMPT_PATHS in require_admin_by_default() #22826
Closed
TCS-UK
started this conversation in
Beta Support
Replies: 1 comment
-
|
Thanks, this is fixed in #22828 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the problem you are having
Frigate Dev Build — Auth Bug Report
Date: 2026-04-09
Frigate version: 0.18.0-8f13932c (dev branch)
Access path: Cloudflare → Traefik → Frigate (nginx:8971 → FastAPI:5001)
Issue A —
/api/profilesreturns 403 for non-admin usersSeverity
Medium. Prevents the profile switcher UI from functioning for viewer/limited/guest users. Produces continuous console errors in the browser.
Symptom
Repeats on a polling interval. Occurs for any authenticated user whose Authelia group maps to a role other than
admin.Root cause
The global FastAPI dependency
require_admin_by_default()infrigate/api/auth.pymaintains a hardcoded set of paths that are exempt from the admin role check:The
/profiles(plural) endpoint was added tofrigate/api/app.pyat line 254 withallow_any_authenticated()— meaning it is intentionally accessible to any logged-in user regardless of role:However,
allow_any_authenticated()is a route-level dependency. In FastAPI, app-level dependencies run alongside route-level dependencies — they are not overridden. The globalrequire_admin_by_default()runs first, finds/profilesnot inEXEMPT_PATHS, checks thatremote-role != "admin", and raisesHTTPException(403)before the route handler is ever reached.Why
/profile(singular) is not affected/profileis inEXEMPT_PATHSand serves the currently authenticated user's own profile object. It was present when the auth refactor was done./profiles(the profile switcher list) is a newer addition and was not added to the exempt list.Affected users
All non-admin roles:
viewer,limited,guest, and any custom role. Admin users are unaffected (they pass the global check).Fix (upstream code change required)
Add
/profilestoEXEMPT_PATHSinfrigate/api/auth.py:File:
frigate/api/auth.pyLocation in source: Inside
require_admin_by_default(), theEXEMPT_PATHSset definition.Workaround (no code change)
None available without modifying the running container. The path check is inside compiled Python running in the container. The Traefik/nginx layers cannot intercept this — it is a FastAPI application-level rejection.
If patching the running container is acceptable (change will not survive image recreation):
Status
Bug: The fix is a one-line addition. Low risk of regression.
Issue B —
/api/debug_replay/statusreturns 403 for non-admin usersSeverity
Low / expected behaviour. The debug replay feature is intentionally admin-only. Console errors are noise but do not indicate a broken configuration.
Symptom
Repeats on a polling interval when logged in as a non-admin user.
Root cause
The endpoint is explicitly gated with
require_role(["admin"])infrigate/api/debug_replay.pyat line 108:This is by design. The debug replay feature allows replaying camera recordings through the detection pipeline — a destructive/diagnostic operation that should only be available to administrators.
Is this a bug?
No. The 403 is the correct and intended response for non-admin users.
Why does the UI poll it for non-admin users?
The Frigate frontend does not yet check the user's role before initiating the polling request. The UI sends the request optimistically and handles the 403 silently (the feature simply remains unavailable). This is a minor UX issue in the frontend — the poll should be skipped entirely if the user lacks admin role — but it is not a security or functional problem.
Fix (upstream — optional UX improvement)
The frontend should check
remote-rolebefore pollingdebug_replay/statusand skip the poll entirely for non-admin users. This would eliminate the console noise.No server-side fix needed or appropriate.
Workaround
None required. The feature is correctly unavailable to limited users. The console error can be ignored.
Summary table
GET /api/profiles/profilestoEXEMPT_PATHSinauth.pyGET /api/debug_replay/statusEnvironment context
auth.enabled: false— all auth delegated to Authelia via Traefik proxy headersRemote-Groupsheader from Authelia → mapped viaproxy.header_map.role_mapfrigate-admin→ Frigate roleadminfrigate-limited→ Frigate rolelimitedfrigate-viewer→ Frigate roleviewerfrigate-guest→ Frigate roleguestremote-role: adminwhenRemote-Groups: frigate-adminis presented (tested directly against FastAPI port 5001)Beta Version
0.18.0-8f13932c
Issue Category
WebUI / Frontend
Frigate config file
naRelevant Frigate log output
Relevant go2rtc log output (if applicable)
No response
Install method
Docker Compose
docker-compose file or Docker CLI command
naOperating system
Debian
CPU / GPU / Hardware
No response
Screenshots
No response
Steps to reproduce
No response
Any other information that may be helpful
No response
Beta Was this translation helpful? Give feedback.
All reactions