llamaCVEVulnerability Intelligence
/
Advisory · GitHub · PyPI · jupyter_enterprise_gateway

GHSA-M434-R2PF-QR3G

Unauthenticated OS command injection via KERNEL_LAUNCHERS_DIR reaching eval exec in Spark-on-Kubernetes launch (gateway host)

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
9.8
Crítica
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición1 dDesde la divulgación, 20 nov 2026, 8:55 a. m.
Detección6 minDesde la divulgación hasta su ingreso al índice
Decisión estimadaAtender
Priorizar en el próximo ciclo de cambios
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, automatizable e impacto técnico total. No hay versión corregida: aplique mitigaciones.
Algún pentester ya está tomando notas de esto.Revisa si el servicio da a internet. Si sí: corre.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
08:55 a. m.
09:00 a. m.
06:34 a. m.
08:55 a. m.
08:19 p. m.
07:44 a. m.
07:09 p. m.
06:34 a. m.
FechaFaseEventoDetalle
Divulgación Publicada GHSA-M434-R2PF-QR3G divulgada · CVSS 9.8 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
GitHub

## Summary
Jupyter Enterprise Gateway allows OS command execution on the Enterprise Gateway host through the client-settable `KERNEL_LAUNCHERS_DIR` environment variable. On a default install (no auth token) this is unauthenticated. The value is used to build `PROG_HOME` in the Spark-on-Kubernetes `run.sh`, which is executed via `eval exec` as a local subprocess on the gateway host (the spark-submit driver launcher, not inside the kernel pod).

## Root Cause
`KERNEL_LAUNCHERS_DIR` is forwarded like any `KERNEL_*` variable and is never validated in any Python code (`grep -rn LAUNCHERS_DIR --include=*.py` = zero hits). In `etc/kernelspecs/spark_python_kubernetes/bin/run.sh`:

KERNEL_LAUNCHERS_DIR=${KERNEL_LAUNCHERS_DIR:-/usr/local/bin/kernel-launchers}
PROG_HOME=${KERNEL_LAUNCHERS_DIR}/python
...
eval exec \
     ... \
     "local://${PROG_HOME}/scripts/launch_ipykernel.py" \
     ...

This script runs on the gateway host: `KubernetesProcessProxy.launch_process` → `ContainerProcessProxy.launch_process` → `self.launch_kernel(kernel_cmd)` (module-level `launch_kernel` = local `Popen`). It is the spark-submit driver launcher, not in-pod execution.

On the latest release (v3.3.0) there is no input validation for `KERNEL_*` values at all. On current `main` the GHSA-j63f allowlist does not cover `KERNEL_LAUNCHERS_DIR`.

## Impact
Arbitrary OS command execution in the Enterprise Gateway server process on the gateway host, with the gateway's identity and cluster credentials (the Kubernetes service-account token, which the project documents as broadly privileged). Unauthenticated by default.

Proof of Concept

POST /api/kernels
Body: {
  "name": "spark_python_kubernetes",
  "env": {"KERNEL_LAUNCHERS_DIR": "/x|touch /tmp/pwned|y"}
}

`PROG_HOME` becomes `/x|touch /tmp/pwned|y/python`; the pipe stage runs `touch /tmp/pwned` in a subshell on the gateway host when `eval exec` evaluates the `local://${PROG_HOME}/...` argument.

## Attack Chain
1. Entry: `POST /api/kernels` with `KERNEL_LAUNCHERS_DIR="/x|touch /tmp/pwned|y"`. Guard on v3.3.0: none (no char filter, no allowlist). Guard on HEAD: `PROHIBITED_ENV_VALUE_CHARS`. Bypass proof: `|`/space not in the frozenset; passes string-type + 4096-length checks.
2. Check: `validate_eval_reaching_env` (HEAD only). Bypass proof: `KERNEL_LAUNCHERS_DIR` not in `EVAL_REACHING_ENVS`, not `*_OPTS`, not referenced by any `*_OPTS` kernelspec entry — reimplemented HEAD validator returns `('PASSED', 'checked=[]')`.
3. Check: `KubernetesProcessProxy.validate_client_env` / `ContainerProcessProxy.validate_client_env`. Guard: inspects only images, volumes, namespace, service-account, extra-spark-opts. Bypass proof: variable never referenced in those checks.
4. Sink: `run.sh` `PROG_HOME=${KERNEL_LAUNCHERS_DIR}/python` → `eval exec ... "local://${PROG_HOME}/..."`, run via local `Popen` on the gateway host. Bypass proof: empirically, `PROG_HOME=/x|touch /tmp/pwned|y/python` under `eval exec` created the marker file.
5. Impact: OS command execution in the gateway server process as the gateway service account.

## Bypass Evidence
- `grep -rn LAUNCHERS_DIR --include=*.py` → zero hits (no Python validation on any version).
- Reimplemented HEAD `validate_eval_reaching_env` → `('PASSED', 'checked=[]')`.
- Default auth: `eg_auth_token = os.getenv("EG_AUTH_TOKEN", os.getenv("KG_AUTH_TOKEN", ""))` = empty; `TokenAuthorizationMixin.prepare` is a no-op when the token is empty → unauthenticated.
- Bash sink test: `eval exec ... local://${PROG_HOME}/...` with a piped value created `/tmp/pwned`.

## Affected Versions
`<= 3.3.0` (latest release). The unreleased 3.4.0 allowlist still omits `KERNEL_LAUNCHERS_DIR`, so the issue persists on current `main`. Equivalent sinks exist in `spark_R_kubernetes` and `spark_scala_kubernetes` `run.sh`.

## Suggested Fix
Validate `KERNEL_LAUNCHERS_DIR` against an allowlist / reject shell metacharacters, or quote `PROG_HOME` usage, and add the variable to the eval-reaching validation set.

---
Reported by zx (Jace) — GitHub: @manus-use

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
10.0/ 10Muy alto
Vector 10.0 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
jupyter_enterprise_gateway≤ 3.4.0
3.4.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
pypijupyter_enterprise_gateway
Sin parche — — 3.4.0 afectada
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/jupyter-server/enterprise_gateway/security/advisories/GHSA-m434-r2pf-qr3g

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.