nebari-dev / nebari-dev/data-science-pack
Security(M-08): every authenticated realm user is admitted by default (allow_all = True)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5
- Forks
- 7
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 13
Description
Summary
The Keycloak authenticator sets allow_all = True, so every user whose token is valid for the configured client is admitted to the hub. In a shared or broadly provisioned realm, users intended for other services enter the JupyterHub trust domain and can consume resources.
Severity: Medium · CWE-863 (Incorrect Authorization)
Validation: Confirmed against HEAD f932d80 on 2026-07-14 (assessed at 69c84f7; unchanged since).
Evidence
config/jupyterhub/00-gateway-auth.py:557-560setsc.Authenticator.auto_login = Trueandc.Authenticator.allow_all = True, with an inline comment noting any KC-authenticated user is admitted and that deployments should tighten viaadmin_groups/allowed_groups.- There is no default
allowed_groupsrestriction; profile and storage controls do not gate baseline hub access.
Impact
Admission depends only on holding a valid token for the client. In a multi-tenant or broadly provisioned realm, users provisioned for other services gain hub access and can consume compute. This admission decision is also what exposes them to the scope surface described in the H-01 issue.
Remediation
- Require an explicit platform-access group or client role, and default to deny when absent.
- Separate admission from administrator and profile authorization.
- Apply resource quotas.
Acceptance criteria
- A valid realm user without the platform grant is denied.
- Grant removal takes effect within a documented interval.
Source: data-science-pack 0.1.0 security assessment (pinned commit 69c84f72df259ec755ed40bfc83f20158c550d55), finding M-08.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in config/jupyterhub/00-gateway-auth.py at lines 557-560 and inspect how the Keycloak authenticator currently admits users and handles group or role settings. Review the existing admin_groups and allowed_groups configuration, then validate the acceptance criteria with a realm user lacking the platform grant and after grant removal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authentication, authorization, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100