hexstrike-ai
- Type
- MCP server
- Scanned
- Nov 12, 2026
- Version
- d689933ff579
- Files read
- 6
HexStrike AI is an MCP server and companion Flask backend that lets an AI agent run over a hundred security testing tools, arbitrary shell commands, Python scripts, and a headless Chrome browser. Its biggest risk is that the backend server listens on all network interfaces (0.0.0.0:8888) without any password or authentication—and launches Chrome with web security disabled—allowing anyone on the same network or any malicious webpage inspected by the browser agent to execute arbitrary commands on your computer.
What it can reach
- Shell commands
- Executes arbitrary shell commands, custom Python scripts, pip package installations, and over 100 command-line security tools (such as nmap, sqlmap, metasploit, ghidra, and prowler) as the user running the server.
- Network
- Starts an unauthenticated HTTP API server on port 8888 across all network interfaces, sends outbound network requests and scans to any target IP or URL, and queries public NVD and GitHub APIs for vulnerability data.
- Files
- Creates, modifies, lists, and deletes files and directories on the host, and reads local binaries, memory dumps, wordlists, and infrastructure-as-code folders passed to scanning tools.
- Browser
- Launches and controls a Chrome or Chromium browser via Selenium to visit webpages, run page JavaScript, read cookies and browser storage, and save screenshots.
- Secrets
- Cloud and container auditing tools (such as prowler, scout-suite, cloudmapper, pacu, and kube-bench) read configured AWS, Azure, GCP, Docker, and Kubernetes credentials when invoked.
- System
- Reads CPU, memory, disk, and active network connection statistics via psutil, and pauses, resumes, or terminates running subprocesses.
Findings
-
CriticalUnauthenticated command-execution server listens on all network interfaces
Although hexstrike_server.py defines API_HOST as 127.0.0.1 and prints 127.0.0.1:8888 in its startup banner, the final app.run call hardcodes 0.0.0.0. Because no endpoint requires a password, API key, or Origin/Host header check, anyone on the same Wi-Fi or local network—or a website using DNS rebinding—can send requests to /api/command or /api/python/execute and run arbitrary commands on the user's computer. Running with --debug also exposes Werkzeug's interactive debugger to the network.
Fix: Pass host=API_HOST ('127.0.0.1' by default) to app.run instead of '0.0.0.0', require a strong authentication token on every endpoint, validate Host and Origin headers, and never enable Flask debug mode on network-accessible interfaces.
-
CriticalBrowser agent disables Chrome web security and sandbox, allowing inspected pages to run local commands
When browser_agent_inspect or burpsuite_alternative_scan visits a URL, BrowserAgent launches Chrome with --disable-web-security, --allow-running-insecure-content, --ignore-certificate-errors, and --no-sandbox. Disabling web security and mixed-content blocking turns off the browser's Same-Origin Policy and CORS checks, so JavaScript on any untrusted webpage being inspected can send a POST request directly to http://127.0.0.1:8888/api/command and execute arbitrary shell commands on the host machine without any AI involvement. Disabling the Chrome sandbox also removes OS process isolation if the page triggers a browser vulnerability.
Fix: Remove --disable-web-security, --allow-running-insecure-content, and --no-sandbox from Chrome options, run browser automation inside an isolated container or VM, and block the browser from reaching 127.0.0.1 and local network addresses.
-
MediumShell command injection across scanner and analyzer tool wrappers
All /api/tools/* endpoints and AI helper routes (including jwt_analyzer, ai_test_payload, api_schema_analyzer, nmap, gobuster, nuclei, and subfinder) interpolate unescaped parameters such as target URLs, domains, payloads, and JWT segments directly into command strings passed to subprocess.Popen with shell=True. For example, jwt_analyzer interpolates the unvalidated payload segment of a JWT and target_url straight into a shell curl command. Users who restrict their MCP client approvals to specific read-only or single-tool scanners while blocking execute_command can still suffer arbitrary command execution if prompt injection supplies shell metacharacters in tool arguments.
Fix: Invoke external tools using argument lists with shell=False instead of shell command strings, strictly validate URLs, domains, and token formats, and disallow arbitrary flag injection where not intended.
-
MediumPath traversal in file management tools allows escaping /tmp/hexstrike_files
FileOperationsManager intends to keep create_file, modify_file, delete_file, and list_files inside /tmp/hexstrike_files, but joins paths using self.base_dir / filename without canonicalizing or checking the result. Relative '../' segments escape the base folder, and in Python's pathlib, an absolute filename completely discards self.base_dir. If an agent is tricked via prompt injection, these tools can overwrite arbitrary user files (such as shell startup files or SSH keys), list arbitrary directories, or delete directories via the HTTP DELETE endpoint.
Fix: Resolve the target path with .resolve() and verify that it stays inside self.base_dir.resolve() using .is_relative_to() before performing any file or directory operation.
-
MediumPredictable temporary script paths in /tmp allow local hijacking
Several tool endpoints write scripts and command files to fixed filenames inside the shared /tmp directory—including /tmp/pwntools_exploit.py, /tmp/angr_analysis.py, /tmp/mcp_msf_resource.rc, /tmp/pacu_commands.txt, /tmp/gdb_commands.txt, and /tmp/r2_commands.txt—before executing them. On a multi-user computer, another local account can pre-create these files or exploit the race window between writing and execution to run arbitrary code as the user running HexStrike.
Fix: Create temporary files securely with tempfile.NamedTemporaryFile or inside a private directory created with tempfile.mkdtemp() (permissions 0700) rather than using hardcoded names in /tmp.
-
LowOWASP ZAP daemon mode defaults to 0.0.0.0 without an API key
In both hexstrike_mcp.py and hexstrike_server.py, the zap_scan wrapper defaults host to 0.0.0.0 and api_key to an empty string. If a user or agent starts OWASP ZAP with daemon=True without overriding these defaults, ZAP binds its proxy and control API to all network interfaces on port 8090 without an API key configured by HexStrike.
Fix: Change the default ZAP daemon host to 127.0.0.1 and require or auto-generate a random API key whenever daemon mode is enabled.
-
LowSample remote MCP configuration uses cleartext HTTP without authentication
The included hexstrike-ai-mcp.json template configures the MCP client to connect to a remote server address over unencrypted HTTP (http://IPADDRESS:8888). Because HexStrike has no built-in TLS or authentication, following this template across a network exposes all commands, scan results, and tool credentials to eavesdropping and tampering in transit.
Fix: Use http://127.0.0.1:8888 in example configurations and document SSH local port forwarding or authenticated HTTPS reverse proxies for remote deployments.
