Critical Pre-Authentication RCE in Marimo Notebook Framework (CVE-2026-39987) Exposes AI and Data Science Systems to Full Compromise

Listen to this Post

Featured Image

Introduction

A newly discovered critical vulnerability in the Marimo Python notebook framework has raised serious concerns across the AI and data science ecosystem. The flaw, identified as CVE-2026-39987, allows unauthenticated remote attackers to execute system-level commands without any credentials. Because Marimo is widely used in machine learning experimentation, analytics workflows, and AI prototyping, the impact of this vulnerability extends far beyond a typical software bug. It potentially exposes sensitive datasets, cloud credentials, and entire infrastructure environments to full takeover.

Summary of the Original

A critical remote code execution vulnerability has been identified in Marimo, a modern Python notebook framework used as an alternative to Jupyter Notebook.
The vulnerability is tracked as CVE-2026-39987 and allows pre-authentication attackers to execute arbitrary system commands.
No authentication or user interaction is required to exploit the flaw.
Marimo is commonly used in AI development, machine learning experimentation, analytics dashboards, and research pipelines.
It is often deployed in Docker containers with access to sensitive resources like databases, APIs, and environment secrets.

This makes the vulnerability especially dangerous in real-world deployments.

A single compromised instance can lead to exposure of API keys, private datasets, and internal systems.
The root cause lies in a missing authentication check in the /terminal/ws WebSocket endpoint.
While other endpoints in Marimo are protected, the terminal endpoint bypasses authentication entirely.
The system accepts WebSocket connections and immediately spawns a shell using pty.fork().
This results in an interactive operating system shell being exposed to the attacker.
AuthenticationMiddleware is present but does not enforce access control on WebSocket connections by default.
Because of this, unauthenticated users can directly access shell execution functionality.

The attack process is simple and highly effective.

An attacker connects to ws://TARGET:2718/terminal/ws without credentials.

The server responds by spawning a system-level shell.

The attacker can then execute arbitrary commands in real time.
These commands run with the same privileges as the Marimo process.

In many containerized environments, this often means root-level access.

Security researchers have confirmed exploitation using minimal WebSocket clients.

Output from executed commands is returned instantly to the attacker.
A detection template for scanning vulnerable systems has already been published.
Reports indicate active exploitation in the wild by threat actors.
Attackers are using the flaw to deploy malware such as NKAbuse.
Some campaigns leverage Hugging Face Spaces to distribute malicious payloads.
This adds stealth by using trusted AI infrastructure for delivery.

All versions of Marimo up to 0.22.x are affected.

Successful exploitation enables data exfiltration and lateral movement.

Attackers may also establish persistence through cron jobs or injected processes.
Container breakout and host compromise are possible in privileged deployments.
The vulnerability represents a severe risk to AI and data science infrastructure.

Immediate patching and mitigation are strongly recommended.

What Undercode Say:

The CVE-2026-39987 vulnerability highlights a recurring weakness in modern AI development tools: trust in internal architecture over strict security enforcement.
Marimo’s design prioritizes interactive and reactive computing, but this convenience introduces attack surfaces that are often underestimated.
The missing authentication check on the /terminal/ws endpoint is not just a coding oversight, it reflects a broader pattern where experimental tools ship with production-grade exposure risks.
WebSocket-based terminal access is particularly dangerous because it bypasses traditional HTTP security controls.
Once a PTY shell is spawned, the security boundary between application and operating system effectively disappears.
This turns a notebook environment into a full remote administration interface with no authentication gate.
In containerized deployments, the risk escalates because many environments run with elevated privileges or insufficient isolation.
Attackers do not need to exploit complex memory corruption bugs; they simply connect and execute commands.
This lowers the barrier for mass exploitation and automated scanning campaigns.
The publication of a Nuclei template further accelerates weaponization by enabling large-scale vulnerability detection.
The involvement of platforms like Hugging Face Spaces in malware distribution demonstrates how trusted ecosystems can be repurposed for malicious activity.
This shifts the threat model from isolated systems to interconnected AI infrastructure.
Organizations often assume internal tools like notebooks are safe because they sit behind APIs or development networks.
However, CVE-2026-39987 shows that exposure of a single endpoint can collapse that assumption entirely.
The most critical issue is privilege inheritance from the Marimo process to the shell.
If Marimo runs as root inside a container, the attacker immediately gains full control.
Even non-root execution can be escalated depending on container configuration.
The absence of default authentication enforcement on WebSocket endpoints is a structural design flaw.
Security middleware that does not automatically protect all routes creates inconsistent protection boundaries.

This inconsistency is exactly what attackers exploit.

The simplicity of the exploit chain means automation is highly likely in real-world attacks.

Once scanned, vulnerable instances can be compromised within seconds.

This makes patch management the only reliable defense in many cases.

Version fragmentation across environments increases exposure duration significantly.

Many research teams prioritize uptime over upgrades, leaving systems vulnerable.
The vulnerability also highlights the importance of least-privilege container design.

Restricting network exposure could have prevented many successful intrusions.

Monitoring WebSocket endpoints should now be considered a baseline security requirement.
AI development frameworks must adopt stricter security defaults moving forward.
Without this shift, similar vulnerabilities will continue to emerge in high-impact tools.
The incident reinforces that convenience-driven architecture often comes at a hidden security cost.
In modern AI infrastructure, that cost can translate into full system compromise.

Fact Checker Results

✔ CVE-2026-39987 is described as a pre-authentication RCE affecting Marimo’s WebSocket terminal endpoint.
✔ Exploitation via unauthenticated WebSocket connection aligns with reported attack mechanics.
✔ Claims of active exploitation and malware delivery require external validation beyond vendor confirmation.

Prediction

If not rapidly patched and monitored, this vulnerability will likely be integrated into automated exploitation toolkits, leading to widespread compromise of exposed AI and data science environments in the near term. 🔴

🕵️‍📝Let’s dive deep and fact‑check.

References:

Reported By: cyberpress.org
Extra Source Hub (Possible Sources for article):
https://www.reddit.com/r/AskReddit
Wikipedia
OpenAi & Undercode AI

Image Source:

Unsplash
Undercode AI DI v2
Bing

🔐JOIN OUR CYBER WORLD [ CVE News • HackMonitor • UndercodeNews ]

💬 Whatsapp | 💬 Telegram

📢 Follow UndercodeNews & Stay Tuned:

𝕏 formerly Twitter 🐦 | @ Threads | 🔗 Linkedin | 🦋BlueSky | 🐘Mastodon