The vulnerability lies in the Strimzi Kafka Operator's Entity Operator, which could be tricked into creating highly privileged Roles and RoleBindings in namespaces it shouldn't have access to. This is a classic 'confused deputy' problem.
The analysis of the patch between version 1.0.0 and 1.0.1 reveals that the fix centers around two main areas:
-
Introducing a feature flag: A new environment variable, STRIMZI_ENTITY_OPERATOR_WATCHED_NAMESPACE_ENABLED, was added. This flag is disabled by default, preventing the Entity Operator from watching namespaces other than the one the Kafka cluster is deployed in, unless explicitly enabled by an administrator.
-
Modifying the reconciliation logic: The EntityOperatorReconciler class, which is responsible for managing the Entity Operator's resources, was updated to respect this new feature flag. The reconcile method within this class is the high-level function that orchestrates the creation of deployments, services, roles, and role bindings. The patch ensures that if the feature is disabled, any attempt to use a watchedNamespace outside the cluster's namespace will fail.
The io.strimzi.operator.cluster.operator.assembly.EntityOperatorReconciler.reconcile function is identified as a key vulnerable function because it is the entry point for the logic that creates the Kubernetes resources. An attacker-controlled Kafka custom resource would trigger this reconciliation, leading to the creation of the privileged Role and RoleBinding in the target namespace.
The io.strimzi.operator.cluster.model.EntityOperator.generateRole function is also identified as vulnerable because it was responsible for defining the overly permissive Role. This function would generate a Role granting permissions to manage Secrets, which is the core of the privilege escalation. The patch modified this function to be more granular and only grant the necessary permissions based on which operator (Topic or User) is being used.
In a runtime profile during exploitation, a stack trace would likely show the KafkaAssemblyOperator calling into EntityOperatorReconciler.reconcile, which in turn would call EntityOperator.generateRole to create the malicious Role in the target namespace.