marimo Reactive Python Notebook Pre-Auth Remote Code Execution (RCE) via Terminal WebSocket Authentication Bypass (CVE-2026-39987)
Executive & SecOps Summary
SECOPS ASSESSMENTAll versions of marimo open-source Python notebook prior to 0.23.0
Unauthenticated remote attackers can establish a connection to the `/terminal/ws` endpoint, obtaining a full PTY shell and executing arbitrary system commands
Immediately upgrade the marimo package to version 0.23.0 or higher
Affected Products & Version Scope
Remediation & Live Workaround Commands
PATCH & WORKAROUND1. Apply Official Security Patch (Recommended)
Upgrade your marimo dependency to version 0.23.0 or higher.
# Using pip
pip install --upgrade marimo>=0.23.0
# Using poetry
poetry add marimo@latest2. Temporary Mitigations (If patching cannot be applied immediately)
- Network Access Control: Restrict access to the marimo server port using firewalls or security groups, allowing connections only from trusted IP addresses.
- Reverse Proxy Authentication: Deploy a reverse proxy (e.g., Nginx, Apache, or OAuth2 Proxy) in front of marimo to enforce authentication (such as Basic Auth or OIDC) before requests reach the application.
- WAF Rules: Configure Web Application Firewall (WAF) rules to block unauthorized WebSocket upgrade requests targeting the
/terminal/wspath.
Scan Your Repositories for Transitive Vulnerable Dependencies in 30 Seconds
Automatically detect vulnerable packages across npm, PyPI, Maven, and Go, and open automated fix Pull Requests without breaking your build.
Technical Root Cause & Exploitation Mechanics
marimo is a reactive Python notebook widely adopted in data science and machine learning workflows. This vulnerability (CVE-2026-39987) stems from a missing authentication check on the terminal WebSocket endpoint /terminal/ws (CWE-306: Missing Authentication for Critical Function).
While other WebSocket endpoints (such as /ws) properly invoke validate_auth() to verify user credentials, the /terminal/ws endpoint only checks the running mode and platform support before accepting connections, completely bypassing authentication verification. Consequently, an unauthenticated attacker can initiate a WebSocket handshake with the vulnerable endpoint, spawn an interactive pseudo-terminal (PTY) shell, and execute arbitrary system commands under the privileges of the running marimo process.
This vulnerability has been assigned a CVSS score of 9.8 (Critical) and is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, indicating active exploitation in the wild.
Official Vendor Advisories & References
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.
Subscribe to Daily Vulnerability Briefings & KEV Alerts
Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.