Summary
In MaxKB, insufficient validation of MCP transport types allows authenticated users to import tool definitions that embed stdio transports with malicious system commands.
When these tools are triggered through an AI Chat node, the MultiServerMCPClient may execute arbitrary commands on the host, turning trusted tool integration into a remote execution vector.
Affected context
This vulnerability occurs in MaxKB deployments that:
- Allow users to import
.toolfiles into the platform - Use MCP referencing mode within AI chat pipelines
- Rely on MultiServerMCPClient for tool execution over different transports
It becomes relevant when tool import and MCP configuration steps do not strictly constrain or verify the allowed MCP transport types, particularly stdio-based transports that can run arbitrary system commands.
Exploit preconditions
- Attack surface: MaxKB web interface and API where
.toolfiles are imported and AI chat flows are configured - Required access: Authenticated user account with permission to import tools or configure AI Chat nodes that reference MCP tools
- Trigger point: Execution of an AI Chat node that references the imported tool, causing MultiServerMCPClient to activate the stdio transport and run the associated command
- Why exploitation is possible: The tool import serializer and MCP referencing logic do not consistently validate or restrict the MCP transport type, allowing attacker-controlled stdio configurations to be treated as trusted tool definitions and executed by the system client
Why this happens
The core issue is a failure to enforce strict validation and sanitization of command-capable transport configurations when importing and referencing MCP tools.
Specifically, the MaxKB tool serializer and chat pipeline step logic accept .tool definitions that specify stdio transports without checking whether the embedded commands are safe or permitted.
This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because attacker-controlled configuration is effectively passed to an execution environment (MultiServerMCPClient) without limiting what commands can be invoked or how arguments are constructed.
Potential impact
- Authenticated users may execute arbitrary OS commands on the MaxKB host
- Attackers could read, modify, or delete application and system data accessible to the MaxKB process
- Compromise of the MaxKB instance, including access to credentials, configuration files, and connected services
- Use of the compromised host as a pivot point for broader lateral movement within the enterprise network
- Disruption of AI assistant functionality through destructive or resource-exhausting commands
General mitigation guidance
Effective mitigation focuses on reducing the trust placed in tool configuration files and constraining how MCP transports operate:
- Apply strict allowlists for supported MCP transport types and reject any configuration that attempts to use command-capable transports (such as unrestricted stdio) in untrusted contexts
- Introduce schema-level validation for
.toolfiles so that command strings, arguments, and transport settings are treated as untrusted data and verified against security policies - Enforce clear separation between configuration data and execution primitives, ensuring that tool definitions cannot directly define raw system commands without an intermediate, validated abstraction
- Run MultiServerMCPClient and related components with least-privilege OS accounts and restricted filesystem and network access, so that even if a command is mis-executed the blast radius is limited
- Prefer sandboxed or containerized execution environments for tools that interact with the operating system to reduce the impact of misconfigurations or unexpected command behavior
How teams detect issues like this
Organizations can detect and manage similar issues by:
- Reviewing code paths that transform configuration files (such as
.tooldefinitions) into executable commands, with particular attention to MCP transport handling and any stdio-based execution - Using static analysis or linters to flag patterns where user-provided configuration is passed into process-spawning APIs, shell invocation wrappers, or transport constructors without validation
- Implementing configuration review and approval workflows for newly imported tools, focusing on transport types, command fields, and any execution-related metadata
- Monitoring runtime logs and audit trails for unusual tool imports, unexpected MCP transport usage, or commands executed via MultiServerMCPClient that deviate from known workflows
- Applying policy-based enforcement (for example, security gateways or admission controllers) that block high-risk transport types or command patterns from being loaded into production environments

