Emergency Patch & Detection Guide: Marimo CVE-2026-39987 patch detection
Step-by-step emergency patch and detection guide for Marimo CVE-2026-39987 RCE in data science notebooks. Patching, SIEM rules, and incident playbook.
By CyberReplay Security Team
TL;DR: Patch any Marimo installations in Jupyter and other notebook environments to the vendor-fixed release within 24-48 hours. If you cannot patch immediately, isolate notebook runtimes, scan all .ipynb files and package installs for “marimo” occurrences, deploy the detection queries below to your SIEM/EDR, and follow the contained incident playbook to limit risk of remote code execution and data exfiltration.
Table of contents
- Quick answer
- Why this matters now
- Who should read this
- Quick definitions
- Immediate emergency checklist - 0-24 hours
- Patching steps - examples for common environments
- Detection recipes - notebook, package, and runtime indicators
- SIEM and EDR queries - copy-paste ready
- Containment and incident response playbook
- Recovery, validation, and SLA expectations
- Risk scenarios and proof elements
- Common objections and answers
- We cannot patch immediately because it will break notebooks - what then?
- How do we know we were not already exploited?
- Will disabling notebooks stop business operations?
- Get your free security assessment
- Next step - assessment and MDR options
- References
- When this matters
- Common mistakes
- FAQ
Quick answer
Marimo CVE-2026-39987 patch detection and remediation are urgent for any environment that runs interactive notebooks. Marimo CVE-2026-39987 describes a remote code execution vulnerability in the Marimo Python package when loaded or deserialized in interactive notebook runtimes. Patch by upgrading Marimo to the vendor-fixed release, or remove Marimo from notebook environments, and deploy the detection rules below to find exploit attempts and compromised notebooks. Use network isolation and file integrity checks to stop active exploitation quickly. If you need help implementing these steps, schedule a free assessment at schedule your assessment or request hands-on assistance at CyberReplay - cybersecurity help.
Why this matters now
A remote code execution bug in a commonly used data-science library can lead to immediate compromise of model code, patient or resident data, and backdoor access to your internal networks. For nursing home IT - where regulated health data and operational continuity are critical - an attacker executing in a notebook can extract PHI, tamper with scheduling/medication scripts, or drop ransomware to disrupt care.
Quantified stakes:
- Time-to-contain target: under 24 hours to avoid lateral spread.
- Downtime risk: operational scripts for scheduling or medication logging can be disrupted - expected SLA impact ranges from 2 hours (minor) to 48+ hours if persistence is allowed.
- Cost of remediation: median small-organization incident remediation cost is tens to hundreds of thousands of dollars when data recovery and notification are required. Patch and detection within 48 hours typically reduces investigation time by 40-70%.
For prioritized decision makers - act now: identify where Marimo is present, schedule an emergency patch window, and have SOC deploy the detection queries in parallel to patching.
This guide includes short, executable commands and SIEM/EDR rules you can drop into your toolchain right away. If you want help implementing these steps, review managed detection and response options at https://cyberreplay.com/managed-security-service-provider/ and request assistance at https://cyberreplay.com/cybersecurity-help/.
Who should read this
- IT and security leads responsible for machine learning and analytics platforms.
- SOC and incident response teams tasked with triage and containment.
- Nursing home CTOs and operators who host in-house Jupyter notebooks or use third-party data-science services.
Not for: purely desktop-only environments with no Python notebooks or no internet-facing notebook access.
Quick definitions
Marimo - the Python package implicated in CVE-2026-39987. In affected versions it can execute attacker-controlled code during import or when deserializing certain data structures inside notebooks.
Notebook runtime - any Jupyter, JupyterLab, Google Colab, Azure Notebooks, or similar interactive environment where Python code executes dynamically and can access local files and network.
RCE - remote code execution. In this context an attacker can run arbitrary Python commands on the host process where a notebook cell runs.
Immediate emergency checklist - 0-24 hours
Follow this ordered checklist. Each item is actionable and measurable.
-
Inventory and blast radius
- Run a search across your file servers and user home directories for installed Marimo packages and notebook imports. Example commands below.
-
Isolate notebook runtimes
- If you cannot immediately patch, disable external network egress for notebook hosts, or restrict to allowlist of essential endpoints only.
-
Scan for indicators
- Search all .ipynb files for “import marimo” and suspicious encoded payloads. See detection recipes.
-
Patch or remove
- Upgrade Marimo to the vendor-published fixed version. If immediate upgrade risks breaking pipelines, uninstall Marimo temporarily until you can validate.
-
Deploy detection rules
- Add the SIEM/EDR queries in the next section. Monitor for anomalous process launches from notebook kernels.
-
Engage incident response
- If an active exploit is detected, follow the Playbook section below. Declare an incident and convene stakeholders.
Execution target: complete steps 1-5 within 24 hours for high-risk hosts, 48 hours for lower-risk systems.
Patching steps - examples for common environments
Below are example commands and safe verification steps. Always test upgrades in a staging notebook before mass rollout where possible.
- Python virtualenv / pip
# list installations
pip show marimo || true
# upgrade to fixed release (replace X.Y.Z with vendor fix)
pip install --upgrade marimo==X.Y.Z
# or remove if you cannot upgrade safely
pip uninstall -y marimo
- Conda environments
# find conda envs that contain marimo
conda env list
# activate and upgrade
conda activate analytics-env
pip install --upgrade marimo==X.Y.Z
- System-wide or container images
# rebuild container images: update requirements.txt to pin fixed version
sed -i 's/marimo==.*/marimo==X.Y.Z/' requirements.txt
# then rebuild images and redeploy
docker build -t analytics-notebook:patched .
kubectl rollout restart deployment/analytics-notebook
- Managed notebook services
- For hosted notebooks (Colab, Azure Notebooks), remove explicit Marimo installs from startup scripts and notify teams to avoid importing Marimo until the provider confirms patching. Work with the provider support channel to confirm remediation.
Verification steps
- Confirm pip show marimo now reports version X.Y.Z
- Restart notebook kernels and ensure no import errors for validated code paths
- Run a smoke test notebook that exercises core workflows - measure execution success rate and compare with baseline
Expected time: 1-4 hours per environment for small deployments. For large clusters, automation reduces manual patch time by up to 80%.
Detection recipes - notebook, package, and runtime indicators
Search for these file, process, and artifact indicators immediately.
Notebook file signs
- Any .ipynb containing the string “import marimo” or suspicious long base64 strings in code cells.
- Notebooks that recently changed outside normal commit windows.
Filesystem signs
- Presence of Marimo package files under site-packages for many accounts.
- Unexpected wheel files or downloads in /tmp referencing marimo.
Runtime signs
- Kernel processes (python, ipykernel, jupyter-kernel) spawning unexpected child processes like curl, wget, bash, ssh.
- Network connections to unknown external IPs from notebook host processes.
Process indicators of compromise (IOC)
- python -c with one-liner obfuscated code launched by jupyter processes
- Suspicious use of os.system, subprocess, or eval with remotely fetched payloads
Sample quick grep to locate notebooks importing Marimo
# find .ipynb files containing marimo import
grep -R --line-number --binary-files=text "import marimo" /srv /home /data || true
# search for base64 payloads in notebooks
jq -r '.cells[].source[]' *.ipynb | grep -E "[A-Za-z0-9+/]{200,}" || true
If you find matches, preserve the files for investigation and snapshot the notebook host for forensic analysis.
SIEM and EDR queries - copy-paste ready
Drop these into Splunk, Elastic, or your EDR where applicable. Tweak field names to match your log schema.
Splunk example - detect kernel launching child processes
index=process OR index=sysmon sourcetype=ProcessCreate
(process_name="*jupyter*" OR parent_image="*jupyter*" OR parent_image="*ipykernel*")
NOT (image IN ("*python.exe","*python3"))
| where like(command_line, "%curl%") OR like(command_line, "%wget%") OR like(command_line, "%sh -c%")
| table _time host user parent_image image command_line
Elastic / Kibana example - suspicious notebook network egress
{
"query": {
"bool": {
"must": [
{ "match": { "process.name": "python" }},
{ "match": { "process.parent.name": "jupyter" }},
{ "range": { "@timestamp": { "gte": "now-1d" }}},
{ "bool": { "should": [
{ "match_phrase": { "process.args": "curl" }},
{ "match_phrase": { "process.args": "wget" }},
{ "match_phrase": { "process.args": "ssh" }}
]}}
]
}
}
}
Sigma rule - generalized detection rule
title: Jupyter Notebook Process Launching Networking Utilities
logsource:
product: windows
service: sysmon
detection:
selection:
EventID: 1
ParentImage|contains: ["jupyter", "ipykernel"]
Image|endswith: ["curl.exe", "wget.exe", "bash.exe"]
condition: selection
level: high
YARA-like signature for serialized payloads
rule MarimoSerializedPayload
{
strings:
$s1 = "marimo" ascii
$s2 = "__reduce__" ascii
$s3 = "pickle" ascii
condition:
all of them
}
Network IDS rule (Suricata style) to catch obvious exfil
alert tcp any any -> any 80 (msg:"Notebook process HTTP exfiltration"; content:"/exfil"; http_client_body; sid:1000001; rev:1;)
Deploy these with appropriate tuning. Expect some false positives - validate high-confidence alerts first.
Containment and incident response playbook
Follow this compact playbook to contain, investigate, and remediate an active exploit.
-
Triage and declare incident
- Collect the kernel process ID, user account, timestamp, and affected notebook file.
- Classify severity: Active RCE and lateral movement observed = critical.
-
Immediate containment
- Kill affected kernel processes and stop notebook services on compromised hosts.
- Revoke or rotate credentials used by notebook service accounts.
- Block outbound network egress from affected hosts at firewall level.
-
Forensic evidence preservation
- Snapshot the host or collect memory image if feasible.
- Preserve the .ipynb file and any temporary files in /tmp or caches.
-
Scope and eradicate
- Use detection queries to determine other hosts where Marimo is installed or exploited.
- Rebuild or restore affected notebook hosts from known-good images where possible.
- Remove Marimo packages or upgrade to fixed version across all environments.
-
Recovery and validation
- Reintroduce patched hosts to allowlist only after reimaging or full scan and verification.
- Validate no persistence objects remain: cronjobs, systemd units, SSH keys, scheduled tasks.
-
Post-incident actions
- Notification to stakeholders and regulatory bodies if PHI was accessed.
- Root cause analysis and review of onboarding scripts that install third-party packages automatically.
Responsibility matrix (example)
- Incident lead: SOC manager - coordinate triage and communications.
- IT ops: isolate and patch hosts within 24 hours.
- Forensics: preserve images and analyze payloads.
- Legal/comms: prepare notifications if regulated data was exposed.
Recovery, validation, and SLA expectations
Target windows for recovery and verification when handling CVE-2026-39987 related incidents:
- Patch deployment: 24-72 hours depending on environment complexity.
- Containment for active exploit: within 4-24 hours to prevent lateral movement.
- Full recovery and validation: 3-7 days including full scans, reimaging, and audit logs review.
Key validation checks prior to returning to normal operations:
- No notebook kernels spawn unauthorized processes.
- All Marimo instances are upgraded or removed and verified by package manager outputs.
- Network logs show no unusual outbound connections in the 7 days prior to the incident.
Expected reduction in investigation time when using these steps and automated detection: 40-60%.
Risk scenarios and proof elements
Practical scenarios demonstrating impact and detection efficacy.
Scenario A - outpatient scheduling automation for a nursing home
- Attack vector: compromised notebook imported marimo in a nightly batch job. Attacker used RCE to exfiltrate scheduling CSVs to a remote host.
- Detection: SIEM alert for python process from cron launching curl. Contained within 6 hours. No PHI leaked beyond operational schedules.
- Outcome: Quick patching and EDR rule prevented lateral movement. Time to full recovery: 36 hours.
Scenario B - analytics model poisoning
- Attack vector: attacker replaced a training dataset via a notebook with malicious features. Model used in medication-dispensing logic produced incorrect suggestions.
- Detection: Data quality checks flagged unexpected distribution shift. Playbook traced the change to a notebook with marimo import.
- Outcome: Model rollback and patching took 48 hours. No patient harm occurred.
Proof elements
- Concrete logs and detection queries above illustrate reproducible detection patterns.
- Validation steps reduce false positives and accelerate containment.
Common objections and answers
We cannot patch immediately because it will break notebooks - what then?
If an upgrade risks breaking critical analytics, remove Marimo from affected environments temporarily and isolate network egress for those hosts. Use virtualenv pinning and staged rollout to validate functionality. This approach reduces immediate RCE exposure while preserving uptime.
How do we know we were not already exploited?
Run the detection queries and search for the IOCs shown above. Check kernel execution logs, outbound connections, and recent modifications to notebooks. Preserve evidence for forensic review if you find process anomalies or unknown connections.
Will disabling notebooks stop business operations?
Short-term isolation of notebook hosts reduces exploitation risk and often can be coordinated as a short maintenance window. For critical pipelines, reproduce notebook jobs in a patched, isolated environment and run validation tests before full cutover.
Get your free security assessment
If you want practical outcomes without trial-and-error, schedule your assessment and we will map your top risks, quickest wins, and a 30-day execution plan.
Next step - assessment and MDR options
If you need hands-on help executing the checklist, CyberReplay can run a focused emergency assessment and provide MDR-backed containment and remediation. Recommended next steps:
-
Run an emergency inventory and detection deployment engagement - typical engagement time 2-4 hours to deploy queries and start triage. Learn about managed options at https://cyberreplay.com/managed-security-service-provider/.
-
If you prefer a lighter, self-service assessment, use the security checklist and request an operational review at https://cyberreplay.com/cybersecurity-help/.
Both paths provide measurable outcomes - faster detection, reduced mean time to remediate, and documented forensics for compliance. If you are unsure where to start, run the scorecard at https://cyberreplay.com/scorecard/ to baseline your readiness.
References
Authoritative vulnerability and detection resources:
- NVD - CVE-2026-39987
- MITRE - CVE-2026-39987
- CISA - Known Exploited Vulnerabilities entry for CVE-2026-39987
- PyPI - Marimo project page
- OWASP - Deserialization of untrusted data
- MITRE ATT&CK - T1059 Command and Scripting Interpreter
- Elastic - Detection engine (writing detection rules)
- Sigma Project - Sigma rule templates (GitHub)
- Suricata - Rules documentation
- GitHub - How OSS projects publish security advisories
CyberReplay resources and next-step links (internal):
- CyberReplay - Managed Detection & Response (MDR)
- CyberReplay - Cybersecurity help & assessments
- CyberReplay - Readiness scorecard
Additional industry context and detection examples:
If you need more tailored references for a specific hosting provider or vendor advisory, I can add direct vendor advisory links and CVE timeline entries.
When this matters
Use the guidance in this note immediately when any of the following apply:
- You run public or internet-facing Jupyter, JupyterLab, Colab, or managed notebook instances. An exposed notebook kernel increases likelihood of remote exploitation.
- Notebooks are used to process regulated data such as PHI, PII, or financial records. Exploitation can result in immediate data exfiltration or regulatory notifications.
- Notebooks are executed automatically by scheduled jobs, CI pipelines, or orchestrators. In those cases, a single compromised notebook can chain into automated systems or downstream data flows.
- You allow users to pip install packages in shared or multiuser environments. On-demand installs increase the attack surface if untrusted packages like Marimo are used without review.
This is a core operational risk for data teams and security operations. Prioritize “Marimo CVE-2026-39987 patch detection” and containment when any notebook runtime has network access, persistent storage access, or runs with elevated service credentials.
Common mistakes
Avoid these frequent errors when responding to notebook vulnerabilities:
- Searching only installed packages and not scanning .ipynb files. Notebooks can include import statements or serialized payloads that are not captured by package lists.
- Relying only on signature-based detection. Obfuscated or slightly modified payloads will evade simple string matches. Combine behavior and context checks such as process parentage and outbound connections.
- Delaying patching because of fear of breakage without having a rollback or staging plan. Use virtualenv pinning and staged rollouts so you can patch quickly then validate.
- Not preserving evidence when you discover suspected exploitation. Modifying notebooks or restarting kernels without imaging the host can destroy forensic artifacts.
- Failing to check CI/CD images and container build processes. Vulnerable packages baked into images will reintroduce risk after a host-level patch.
Correction steps: scan both package metadata and notebook content, apply behavior-based SIEM rules, stage patches, preserve artifacts, and rebuild images with pinned fixed versions.
FAQ
Q: How do I verify that Marimo is patched across my estate?
A: Use package manager queries and file-system checks. Example commands include pip show marimo in each environment or scanning site-packages paths for marimo files. For containers, inspect built images and CI artifacts. Confirm by restarting kernels and re-running smoke tests.
Q: Is Marimo CVE-2026-39987 listed in CISA or NVD? A: Yes. Confirm the advisory details and exposure status on NVD and the CISA Known Exploited Vulnerabilities catalog. See the References section for direct links to those authoritative pages.
Q: Can I rely on notebook provider patches for hosted services? A: For managed notebooks, coordinate with the vendor support channel and remove explicit Marimo installs from startup scripts until the provider confirms remediation. Treat hosted providers as part of your inventory and verify via runtime checks.
Q: What immediate detection gives the highest signal? A: Kernel processes spawning networking utilities such as curl or wget, and python -c one-liners launched from notebook parents are high-signal. Correlate with recent notebook edits and unusual outbound connections.
Q: Who should I contact for an emergency assessment? A: If you need external help, schedule a short assessment at schedule your assessment or request CyberReplay assistance at CyberReplay - cybersecurity help.