This report performs a deep-dive audit of the Hub's authentication layer and user management routes in user.py, focusing on OIDC Security, Open Redirect protection, and Administrative Data Privacy.
| Factor | Status | Observation |
|---|---|---|
| III. Config | ✅ Success | Unified Auth Toggles: Feature flags for OIDC_ENABLED and ALLOW_PASSWORD_LOGIN are correctly propagated from the environment into the routing logic, allowing secure "Day 1" local fallbacks. |
| VI. Processes | ✅ Success | Stateless Session Management: Authentication state is consistently derived from DB records, ensuring that Hub replicas remain interchangeable. |
app/api/routes/user.pyThe gateway for user identity, preferences, and OIDC handshakes.
[!CAUTION] Open Redirect Vulnerability (OIDC Callback) Line 70:
frontend_redirect_url = f"{state}?user_id={user_id}"The OIDC callback handler uses thestatequery parameter directly as a redirection target without validation.The Exploit: An attacker can send a victim a link like
ai.jerxie.com/api/v1/users/login?frontend_callback_uri=https://evil-site.com. After the victim logs in, the Hub will redirect them tohttps://evil-site.com?user_id=..., leaking their internal User ID and potentially allowing for session hijacking on the attacker's site.Fix: Whitelist allowed redirect domains or ensure the
stateis compared against the originally requestedfrontend_callback_uristored in a secure cookie.
Identified Problems:
export_user_config_yaml route (Line 464) exports ALL plaintext API keys for all providers in a single YAML file. For production security (Factor VII), these keys should be redacted (masked with ***) unless an explicit reveal_secrets=true flag is passed by an Admin with Multi-Factor Authentication.state parameter to eliminate the Open Redirect vulnerability.login_local (Line 107) is wrapped in a rate-limiting middleware (to be reviewed in app.py) to prevent brute-force attacks on the local account database.This concludes Feature 18. I have persisted this report to /app/docs/reviews/feature_review_auth_user_management.md. Should I apply a patch to fix the Open Redirect vulnerability immediately?