Summary
MaxKB contains an OS command injection vulnerability in its AWS Bedrock credential configuration workflow. An authenticated workspace member may manipulate credential fields so that a later profile selection causes botocore to execute attacker-controlled commands with the application's privileges, potentially including root.
Affected context
The issue occurs in MaxKB deployments that support AWS Bedrock credentials and persist those credentials to the standard AWS configuration location. It becomes risky when an authenticated workspace member can supply control characters in credential fields and the resulting configuration is later consumed by botocore without safe handling or strict normalization.
Exploit preconditions
- Attack surface: MaxKB's authenticated workspace and AWS Bedrock credential-management functionality
- Required access: Authenticated membership in a workspace with permission to configure or update AWS credentials
- Trigger point: A later model-validation or AWS client operation that loads the manipulated AWS profile
- Why exploitation is possible: Unsafely handled credential input can alter the generated AWS configuration and enable execution of a configured credential-process command
- Privilege context: The command may run with the privileges of the MaxKB service, which can be highly privileged in some deployments
Why this happens
The vulnerability results from writing attacker-influenced credential values into an AWS configuration file without treating control characters and configuration boundaries as untrusted input. This can allow data intended as a credential value to introduce additional profile settings, including executable credential-provider directives. When botocore loads the altered profile, it may invoke the configured process, mapping the behavior to CWE-78: Improper Neutralization of Special Elements used in an OS Command.
Potential impact
- An attacker may execute arbitrary operating-system commands in the MaxKB runtime
- Commands could run with root or another highly privileged service identity
- Application data, model configuration, or stored credentials could be accessed or modified
- The host or container environment could be used for persistence or lateral movement
- An attacker could disrupt AI assistant availability or alter workspace behavior
General mitigation guidance
Mitigation generally focuses on preventing user-controlled values from becoming executable AWS configuration directives.
Common defensive patterns include:
- Treating credential fields strictly as opaque data and rejecting control characters, delimiters, and unexpected configuration syntax
- Avoiding direct string construction for shared configuration files; use safe structured APIs or tightly controlled serialization
- Allowing only explicitly supported AWS profile settings and excluding executable provider mechanisms where they are not required
- Separating application-managed credentials from user-managed AWS configuration and using narrowly scoped credential sources
- Running the service with a dedicated least-privilege identity, avoiding root where practical, and restricting filesystem and process permissions
- Applying secret-management controls so long-lived access keys are not unnecessarily written to local configuration files
How teams detect issues like this
Detection can combine code analysis, configuration monitoring, and runtime controls:
- Use static analysis to identify concatenation or interpolation of user-controlled values into AWS configuration files
- Review code for credential-field handling that fails to reject control characters or profile delimiters
- Monitor writes to AWS credential and configuration paths, especially changes that introduce process-based credential providers
- Apply policy checks that prohibit executable credential-provider settings in application-managed profiles
- Alert on unexpected child processes launched by the MaxKB service or its model-validation workflows
- Use automated code-review tools to flag command construction, unsafe configuration serialization, and insufficient input normalization

