# CVE-2024-41942: JupyterHub has a privilege escalation vulnerability with the `admin:users` scope

> Users with admin:users scope can escalate to full admin privileges in JupyterHub, requiring an upgrade to patched versions.

- **Severity:** High 7.2 (`CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 Aug 2024
- **Updated:** 8 Aug 2024
- **Also known as:** BIT-jupyterhub-2024-41942, DEBIAN-CVE-2024-41942, GHSA-9x4q-3gxw-849f, PYSEC-2024-200, UBUNTU-CVE-2024-41942

## What is CVE-2024-41942?

CVE-2024-41942 is a high-severity vulnerability in jupyterhub, published on 8 Aug 2024. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

JupyterHub is software that allows one to create a multi-user server for Jupyter notebooks. Prior to versions 4.1.6 and 5.1.0, if a user is granted the `admin:users` scope, they may escalate their own privileges by making themselves a full admin user. The impact is relatively small in that `admin:users` is already an extremely privileged scope only granted to trusted users.
In effect, `admin:users` is equivalent to `admin=True`, which is not intended. Note that the change here only prevents escalation to the built-in JupyterHub admin role that has unrestricted permissions. It does not prevent users with e.g. `groups` permissions from granting themselves or other users permissions via group membership, which is intentional. Versions 4.1.6 and 5.1.0 fix this issue.

Weakness: CWE-274 (Improper Handling of Insufficient Privileges)

## Which versions are affected by CVE-2024-41942?

6 open source packages ship an affected version, including jupyterhub. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `jupyterhub` | Bitnami | All versions | 4.1.6, 5.1.0 |
| `jupyterhub` | PyPI | All versions | 4.1.6 |
| `jupyterhub` | PyPI | All versions | 4.1.6 |
| `jupyterhub` | PyPI | All versions | 4.1.6 |
| `jupyterhub` | PyPI | From 5.0.0 | 5.1.0 |
| `jupyterhub` | PyPI | From 5.0.0 | 5.1.0 |

Products: Jupyter Jupyterhub.

## How do I fix CVE-2024-41942?

Upgrade jupyterhub to a fixed version for your release line: 4.1.6 or 5.1.0.

## Is CVE-2024-41942 being exploited?

There is no known exploitation of CVE-2024-41942 in the wild and no public exploit code.

## Other vulnerabilities in jupyterhub

- [CVE-2024-28233](https://insights.sbomify.com/CVE-2024-28233/): XSS in JupyterHub via Self-XSS leveraged by Cookie Tossing (high 8.1)
- [CVE-2019-10255](https://insights.sbomify.com/CVE-2019-10255/): Open Redirect vulnerability in jupyterhub and notebook (medium 6.1)
- [CVE-2026-40864](https://insights.sbomify.com/CVE-2026-40864/): JupyterHub: Cross-origin form POSTs bypass XSRF (medium 5.4)
- [CVE-2026-33709](https://insights.sbomify.com/CVE-2026-33709/): JupyterHub has an Open Redirect Vulnerability (medium 5.1)
- [CVE-2020-36191](https://insights.sbomify.com/CVE-2020-36191/): Cross-Site Request Forgery in JupyterHub (medium 4.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-41942 and fix it if it is affected.

What it is: CVE-2024-41942 is a high-severity vulnerability in jupyterhub, published on 8 Aug 2024. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-41942 in the wild and no public exploit code.

Affected packages and fixed versions:
- jupyterhub (Bitnami): affected all versions; fixed in 4.1.6, 5.1.0
- jupyterhub (PyPI): affected all versions; fixed in 4.1.6
- jupyterhub (PyPI): affected all versions; fixed in 4.1.6
- jupyterhub (PyPI): affected all versions; fixed in 4.1.6
- jupyterhub (PyPI): affected from 5.0.0; fixed in 5.1.0
- jupyterhub (PyPI): affected from 5.0.0; fixed in 5.1.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-41942/ (Markdown: https://insights.sbomify.com/CVE-2024-41942/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-41942
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-41942
- OSV: https://osv.dev/vulnerability/CVE-2024-41942

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-41942/
Summaries are generated and may contain mistakes; the official description above is the record.
