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

Source: https://junglewise.ai/threats/cve-2026-39987-marimo-pre-auth-remote-code-execution-via-terminal-websocket  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-04-08. Updated: 2026-05-15  
License: CC BY 4.0 with a link back

CVE-2026-39987 · Severity: critical · CVSS 9.8 · Exploited in the wild · Published 2026-04-08

Marimo, a Python-based interactive notebook used for data science and development, contains a critical security flaw that allows unauthorized users to take control of the host system. By accessing a specific web address used for terminal communications, an attacker can bypass all security checks and execute commands as if they were a legitimate user. This could lead to the theft of sensitive data, installation of malware, or complete disruption of the development environment.

Technologies: [Marimo](https://junglewise.ai/threats/technologies/marimo), [marimo (PyPI)](https://junglewise.ai/threats/technologies/pypi-marimo). Vendors: [Marimo](https://junglewise.ai/threats/vendors/marimo), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-39987 exploited in the wild?** Yes. CVE-2026-39987 is known to be exploited in the wild, first recorded on 23 April 2026. Treat it as urgent.

**How severe is CVE-2026-39987?** Critical severity, with a CVSS score of 9.8, published 8 April 2026.

**Which products and versions are affected?** marimo (PyPI) ECOSYSTEM:introduced=0,fixed=0.23.0.

**Is there a fix for CVE-2026-39987?** Yes. marimo (PyPI): upgrade to 0.23.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-39987 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-39987?** Check whether you run Marimo or marimo (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- marimo (PyPI): upgrade to 0.23.0 or later

  ```sh
  pip install "marimo>=0.23.0"
  ```


## Technical details

A remote code execution (RCE) vulnerability exists in Marimo due to missing authentication (CWE-306) on the /terminal/ws WebSocket endpoint. While other endpoints correctly implement the validate_auth() function, the terminal endpoint only verifies the running mode and platform support before establishing a connection. An unauthenticated attacker can connect to this endpoint over the network to obtain a full pseudo-terminal (PTY) shell. This allows for arbitrary command execution with the privileges of the Marimo process. The vulnerability has been observed being exploited in the wild and is addressed in version 0.23.0.

## Affected products

- marimo-team marimo < 0.23.0

## Identifiers

- CVE-2026-39987
- GHSA-2679-6mx9-h9xc
- PYSEC-2026-407

## Timeline

- 2026-04-09: disclosed: Initial disclosure by GitHub, Inc.
- 2026-04-23: kev added: Added to CISA Known Exploited Vulnerabilities catalog
- 2026-04-23: patched: Fix confirmed in version 0.23.0

## Related threats

- [marimo configuration injection via PEP-723 metadata](https://junglewise.ai/threats/cve-2026-67618-marimo-configuration-injection-via-pep-723-metadata)
- [marimo XSS via file query parameter in notebook page](https://junglewise.ai/threats/cve-2026-54386-marimo-xss-via-file-query-parameter-in-notebook-page)
- [marimo vulnerable to proxy abuse of /mpl/{port}/](https://junglewise.ai/threats/marimo-vulnerable-to-proxy-abuse-of-mpl-port-57847eda)
