Skip to content

fix: run notebook kernels as the requesting user in multi-user mode#142

Open
EllaFr wants to merge 1 commit into
open-webui:mainfrom
EllaFr:fix/notebooks-per-user-kernel
Open

fix: run notebook kernels as the requesting user in multi-user mode#142
EllaFr wants to merge 1 commit into
open-webui:mainfrom
EllaFr:fix/notebooks-per-user-kernel

Conversation

@EllaFr

@EllaFr EllaFr commented Jul 23, 2026

Copy link
Copy Markdown

In multi-user mode the file endpoints isolate users through UserFS, but the notebook endpoints don't apply the same boundary. The kernel is started as the server process rather than the requesting user, create_session opens the requested path without the UserFS check the file APIs use, and sessions are keyed by session id with no owner.

Run the notebook kernel as the requesting OS user via sudo -u (mirroring how create_runner runs commands), so cell code executes with that user's OS permissions rather than the server's. The Jupyter connection file is placed in /tmp and made group-readable to that user so the kernel can read it while the server stays its owner. create_session also validates the notebook path through UserFS.is_path_allowed, each session is bound to the requesting X-User-Id so execute, status and delete only work for its owner, and the kernel starts in the user's home so relative paths resolve there. Single-user mode is unchanged.

Contributor License Agreement

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant