CVE-2026-77934
Insecure default config lets any user run unsandboxed Python subprocesses, bypassing filters.
- CVSS 8.7
- CWE-1188
- Configuration Issues
- Remote
Coze Studio before 0.5.0 contains an insecure default configuration that allows any registered user to execute commands by running workflow code nodes in an unsandboxed python3 subprocess. Attackers can bypass the regex import filter with __import__('subprocess') to run commands, stealing environment variables, model API keys, and accessing MySQL, MinIO, Redis and etcd.
- CWE
- CWE-1188
- CVSS base score
- 8.7
- Published
- 2026-10-20
- OWASP
- A03 Injection
- Orthogonal defect classification
- Interface
- Code defect classification
- Missing Check
- Category
- Configuration Issues
- Subcategory
- Remote File Inclusion (RFI)
- Accessibility scope
- Remote
- Impact
- Arbitrary Code Execution
- Affected component
- Python
Solution
Upgrade Coze Studio to version 0.5.0 or later, where the insecure default configuration and unsandboxed subprocess execution are fixed.
Vulnerable code sample
import re
def run_workflow_node(node_code: str):
"""
Executes user‑provided workflow node code in a subprocess.
"""
# Simple import filter – only allows modules matching the whitelist regex.
allowed = re.compile(r'^(json|math|datetime)$')
for line in node_code.splitlines():
m = re.search(r'^\s*import\s+(\w+)', line)
if m and not allowed.match(m.group(1)):
raise ValueError("Disallowed import")
# VULNERABLE: dynamic import bypasses filter and runs arbitrary commands
subprocess = __import__('subprocess')
proc = subprocess.Popen(['python3', '-c', node_code],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = proc.communicate()
return out.decode(), err.decode()Patched code sample
import re
import ast
def run_workflow_node(node_code: str):
"""
Executes user‑provided workflow node code in a subprocess after static analysis.
"""
# FIX: reject any use of subprocess module during static analysis
class ImportVisitor(ast.NodeVisitor):
def visit_Import(self, node):
for alias in node.names:
if alias.name == 'subprocess':
raise ValueError("Disallowed import: subprocess")
def visit_ImportFrom(self, node):
if node.module == 'subprocess':
raise ValueError("Disallowed import: subprocess")
ast.parse(node_code) # syntax check
ImportVisitor().visit(ast.parse(node_code))
allowed = re.compile(r'^(json|math|datetime)$')
for line in node_code.splitlines():
m = re.search(r'^\s*import\s+(\w+)', line)
if m and not allowed.match(m.group(1)):
raise ValueError("Disallowed import")
# Safe execution using a controlled subprocess without dynamic imports
import subprocess
proc = subprocess.Popen(['python3', '-c', node_code],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = proc.communicate()
return out.decode(), err.decode()Cite this entry
@misc{vaitp:cve202677934,
title = {{Insecure default config lets any user run unsandboxed Python subprocesses, bypassing filters.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-77934},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-77934/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
