# CVE-2026-39987: Marimo Remote Code Execution

> Unauthenticated attackers can execute arbitrary system commands via an unsecured terminal WebSocket endpoint in marimo notebooks.

- **Severity:** Critical 9.3 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Yes, since 23 Apr 2026 (CISA KEV)
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Apr 2026
- **Updated:** 24 Apr 2026
- **Also known as:** GHSA-2679-6mx9-h9xc, PYSEC-2026-407

## What is CVE-2026-39987?

CVE-2026-39987 is a critical authentication bypass vulnerability in marimo-team marimo, published on 9 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

marimo is a reactive Python notebook. Prior to 0.23.0, Marimo has a Pre-Auth RCE vulnerability. The terminal WebSocket endpoint /terminal/ws lacks authentication validation, allowing an unauthenticated attacker to obtain a full PTY shell and execute arbitrary system commands. Unlike other WebSocket endpoints (e.g., /ws) that correctly call validate_auth() for authentication, the /terminal/ws endpoint only checks the running mode and platform support before accepting connections, completely skipping authentication verification. This vulnerability is fixed in 0.23.0.

Weakness: CWE-306 (Missing Authentication for Critical Functionality)

## Which versions are affected by CVE-2026-39987?

3 open source packages ship an affected version, including marimo. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `marimo` | PyPI | All versions | 0.23.0 |
| `marimo` | PyPI | All versions | 0.23.0 |
| `marimo` | PyPI | All versions | 0.23.0 |

Products: Coreweave Marimo.

## How do I fix CVE-2026-39987?

Upgrade marimo to 0.23.0 or later. US federal agencies must fix it by 7 May 2026.

## Is CVE-2026-39987 being exploited?

Yes. Attackers have exploited CVE-2026-39987 in the wild since at least 23 Apr 2026.

Public exploit code:

- Marimo Pre Authentication RCE (github_poc): https://github.com/Th3Purge/CVE-2026-39987
- CVE-2026-39987 Exploitation Tool - Marimo < 0.23.0 Pre-Auth RCE (WebSocket) (github_poc): https://github.com/M3PH1569/CVE-2026-39987-POC
- CVE-2026-39987: Marimo Python Notebook Pre-Auth RCE (CVSS 9.3). Python & Nmap NSE detection scripts. Missing authentication on /terminal/ws WebSocket endpoint gives attackers a full PTY shell without any credentials. Exploited in the wild within 10 hours of disclosure. Fixed in Marimo 0.23.0. (github_poc): https://github.com/keraattin/CVE-2026-39987
- marimo is a reactive Python notebook. Prior to 0.23.0, Marimo has a Pre-Auth RCE vulnerability (github_poc): https://github.com/Nxploited/CVE-2026-39987
- Marimo Pre-Auth RCE (github_poc): https://github.com/h3raklez/CVE-2026-39987
- https://github.com/rootdirective-sec/CVE-2026-39987-Lab (github_poc): https://github.com/rootdirective-sec/CVE-2026-39987-Lab

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-39987 and fix it if it is affected.

What it is: CVE-2026-39987 is a critical authentication bypass vulnerability in marimo-team marimo, published on 9 Apr 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: Yes. Attackers have exploited CVE-2026-39987 in the wild since at least 23 Apr 2026.

Affected packages and fixed versions:
- marimo (PyPI): affected all versions; fixed in 0.23.0
- marimo (PyPI): affected all versions; fixed in 0.23.0
- marimo (PyPI): affected all versions; fixed in 0.23.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-39987/ (Markdown: https://insights.sbomify.com/CVE-2026-39987/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-39987
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-39987
- OSV: https://osv.dev/vulnerability/CVE-2026-39987

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-39987/
Summaries are generated and may contain mistakes; the official description above is the record.
