mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-27 20:07:29 -05:00
[GH-ISSUE #20651] issue: Audit logging skips browser/cookie-based sessions - only logs API key requests #34777
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @domklusak on GitHub (Jan 13, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20651
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.7.2
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Audit logging should capture all authenticated requests, regardless of whether authentication is via:
Authorizationheader (API keys)Suggested fix:
The
_should_skip_auditingmethod should also check for valid session cookies or attempt to resolve the user from the request context.Actual Behavior
The audit logging middleware (
AuditLoggingMiddleware) only logs requests that contain an Authorization header. This means all browser-based user activity is not captured in audit logs, since web sessions use cookies (owui-session) for authentication, not Authorization headers.Only API key-based requests (using sk-... tokens in the Authorization header) are logged.
Authentication: OAuth (Okta OIDC)
Root Cause
In
backend/open_webui/utils/audit.py,the_should_skip_auditingmethod skips all requests without anauthorizationheader:Steps to Reproduce
ENABLE_LOGIN_FORM=false
ENABLE_OAUTH_SIGNUP=true
-rw-r--r-- 1 root root 0 Jan 13 21:25 audit.log
drwxr-xr-x 1 root root 49 Jan 13 21:25 cache
drwxr-xr-x 2 root root 6 Jan 13 21:25 uploads
AUDIT_LOG_LEVEL: "REQUEST_RESPONSE"
ENABLE_AUDIT_STDOUT: "true"
ENABLE_AUDIT_LOGS_FILE: "true"
AUDIT_EXCLUDED_PATHS: ""
@tjbck commented on GitHub (Jan 22, 2026):
Should be addressed in dev!