Agente JVMTI en tiempo de ejecución que desactiva el intrínseco de decodificación Base64 vulnerable en JVM en ejecución mediante directivas del compilador y retransformación de clases, parcheando CVE-2026-114938 sin reiniciar.
Adjunta un agente a una JVM en ejecución para que el intrinsic vulnerable (_base64_decodeBlock, el stub de decodificación Base64 AVX-512 VBMI de x86_64) deje de ejecutarse.
No se escribe directamente en la memoria de la JVM. Utiliza únicamente interfaces compatibles: directivas del compilador y retransformación de clases.
El cambio reside únicamente en memoria y se pierde al reiniciar. Añade
-XX:-UseBASE64Intrinsicsa las opciones de arranque de la JVM en tu próximo despliegue.
curl | sh)curl -fsSL https://files.xint.io/java4shell | sh # check, then apply after typing "yes"
curl -fsSL https://files.xint.io/java4shell | sh -s -- --dry-run # check only
curl -fsSL https://files.xint.io/java4shell | sh -s -- --yes [PID ...] # apply without prompting (automation)
# To pin the installer download itself as well:
curl -fsSL --pinnedpubkey 'sha256//cPNKVMMSBKRsqcDzoa/6g1kBw43KpwPCZYPU38YC1Ig=;sha256//QYVBGSU2fPejSOSSjdZ9qAChBxEHY/8AcSb9/SSeYPQ=' https://files.xint.io/java4shell | sh
java4shell descarga el jar y apply.sh con la clave pública hoja de files.xint.io (SPKI) fijada (curl --pinnedpubkey, tanto el certificado ECDSA como el RSA). Después verifica su SHA-256. Si alguna comprobación falla, no se ejecuta nada.https://files.xint.io/java4shell (instalador)https://files.xint.io/java4shell.d/CVE-2026-114938.jarhttps://files.xint.io/java4shell.d/apply.shapply.sh, actualiza JAR_SHA256 / APPLY_SHA256 en java4shell.PINS. Para uso a largo plazo, es preferible un certificado con una clave estable, como un certificado personalizado de Cloudflare.
openssl s_client -connect files.xint.io:443 -servername files.xint.io </dev/null 2>/dev/null \
| openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | base64
# RSA certificate: add -tls1_2 -cipher ECDHE-RSA-AES128-GCM-SHA256 to s_client
Requisitos:
jcmd (un JDK) está disponible donde lo ejecutes.| Entorno | Dónde | Comando |
|---|---|---|
| VM / bare metal, Java iniciado directamente | En el servidor (JDK instalado) | curl -fsSL https://files.xint.io/java4shell | sudo sh |
| Docker, la imagen de la app contiene un JDK | Dentro del contenedor de la app | docker exec -it <ctr> sh -c 'curl -fsSL https://files.xint.io/java4shell | sh' |
| Docker, imagen solo con JRE o sin JDK en el host | Contenedor auxiliar JDK privilegiado en el espacio de nombres PID del host (cubre todas las JVM de contenedores del host) | docker run --rm -it --privileged --pid=host eclipse-temurin:21-jdk sh -c 'curl -fsSL https://files.xint.io/java4shell | sh' |
| El host tiene un JDK | En el host como root (las JVM de contenedores también son visibles) | curl -fsSL https://files.xint.io/java4shell | sudo sh |
| Kubernetes, por pod | kubectl exec (la imagen contiene un JDK) | kubectl exec -it <pod> -- sh -c 'curl -fsSL https://files.xint.io/java4shell | sh' |
| Kubernetes, por nodo | Pod de depuración del nodo (funciona para imágenes JRE) | kubectl debug node/<node> -it --profile=sysadmin --image=eclipse-temurin:21-jdk -- sh -c 'curl -fsSL https://files.xint.io/java4shell | sh' |
-it es necesario para el prompt interactivo de "yes". Para automatización, añade sh -s -- --yes../apply.sh --dry-run, luego ./apply.sh./tmp del contenedor objetivo debe ser escribible (el mecanismo de attach de la JVM lo utiliza).apply.sh./apply.sh --dry-run # check all running JVMs (changes nothing)
./apply.sh # apply to all running JVMs (only exposed JVMs are changed; asks "yes")
./apply.sh 1234 5678 # specific PIDs only
./apply.sh --force 1234 # apply regardless of the checks
./apply.sh --yes # no confirmation prompt (automation)
*/bin/java (jcmd mismo queda excluido).STATUS: patched / not patched.jcmd en PATH, y ser root o el mismo usuario que el JVM objetivo./proc/PID/root/tmp). El host entonces también necesita un JDK.NS=default; POD=my-app-xxxx; C=app # container name
kubectl cp CVE-2026-114938.jar $NS/$POD:/tmp/CVE-2026-114938.jar -c $C
kubectl cp apply.sh $NS/$POD:/tmp/apply.sh -c $C
kubectl exec -n $NS $POD -c $C -- bash /tmp/apply.sh --dry-run
kubectl exec -n $NS $POD -c $C -- bash /tmp/apply.sh --yes
Varios pods a la vez:
for p in $(kubectl get pods -n $NS -l app=my-app -o name); do
kubectl cp CVE-2026-114938.jar $NS/${p#pod/}:/tmp/CVE-2026-114938.jar -c $C
kubectl cp apply.sh $NS/${p#pod/}:/tmp/apply.sh -c $C
kubectl exec -n $NS ${p#pod/} -c $C -- bash /tmp/apply.sh --yes
done
No se necesita jcmd en las imágenes de la aplicación, y cada JVM del nodo se gestiona a la vez.
# Start a node debug pod (hostPID, privileged) with a JDK image
kubectl debug node/<node> -it --profile=sysadmin --image=eclipse-temurin:21-jdk -- bash
# From another terminal, copy the package (debug pod name is printed by the command above)
kubectl cp CVE-2026-114938 <debug-pod>:/tmp/CVE-2026-114938
# Inside the debug pod
bash /tmp/CVE-2026-114938/apply.sh --dry-run # check every JVM on the node
bash /tmp/CVE-2026-114938/apply.sh # apply after confirmation ("yes")
docker cp CVE-2026-114938.jar <ctr>:/tmp/ && docker cp apply.sh <ctr>:/tmp/
docker exec -it <ctr> bash /tmp/apply.sh
jcmd <pid> JVMTI.agent_load /path/CVE-2026-114938.jar # apply
jcmd <pid> JVMTI.agent_load /path/CVE-2026-114938.jar dry-run # check only
jcmd <pid> JVMTI.agent_load /path/CVE-2026-114938.jar force # apply regardless of checks
La salida va al stderr de la JVM objetivo y a <jar dir>/CVE-2026-114938-<pid>.log.
Para verificar: jcmd <pid> Compiler.directives_print | grep 'Base64$Decoder.decode0'
Si cualquiera de las siguientes condiciones es cierta, el agente imprime not exposed y sale sin cambiar nada. force se aplica de todos modos.
avx512_vbmi o avx512bw. Esto también cubre AVX-512 reducido mediante UseAVX.UseBASE64Intrinsics=false, es decir, ya deshabilitado en el arranque.Ejecutarlo de nuevo en la misma JVM omite la adición de la directiva (ya presente) y solo rehace la desoptimización.