CVE-2025-59361 Overview
CVE-2025-59361 is a critical OS command injection vulnerability affecting the cleanIptables mutation function in Chaos Controller Manager, a component of the Chaos Mesh chaos engineering platform for Kubernetes. The vulnerability allows attackers to inject arbitrary operating system commands through the vulnerable mutation handler. When chained with CVE-2025-59358, this vulnerability enables unauthenticated in-cluster attackers to achieve remote code execution across the entire Kubernetes cluster, potentially leading to complete cluster takeover.
Critical Impact
Unauthenticated attackers within the cluster network can exploit this command injection vulnerability to execute arbitrary code on cluster nodes, potentially compromising the entire Kubernetes infrastructure and all workloads running within it.
Affected Products
- Chaos Mesh (chaos-mesh:chaos_mesh)
- Chaos Controller Manager component
- Kubernetes clusters running vulnerable Chaos Mesh installations
Discovery Timeline
- 2025-09-15 - CVE-2025-59361 published to NVD
- 2025-10-14 - Last updated in NVD database
Technical Details for CVE-2025-59361
Vulnerability Analysis
This vulnerability is classified as CWE-78 (Improper Neutralization of Special Elements used in an OS Command), commonly known as OS Command Injection. The cleanIptables mutation in Chaos Controller Manager fails to properly sanitize user-controlled input before incorporating it into operating system commands. This architectural flaw allows attackers to inject malicious command sequences that are executed with the privileges of the Chaos Controller Manager process.
The critical nature of this vulnerability stems from its position within the Kubernetes cluster architecture. Chaos Controller Manager typically runs with elevated privileges to perform chaos engineering operations, meaning successful exploitation grants attackers significant access to cluster resources and the underlying infrastructure.
Root Cause
The root cause is insufficient input validation and sanitization in the cleanIptables mutation handler. User-supplied data is passed directly to shell command execution without proper escaping or validation of special characters. This allows attackers to break out of the intended command context and execute arbitrary commands by injecting shell metacharacters such as semicolons, backticks, or command substitution sequences.
Attack Vector
The attack vector is network-based and requires no user interaction or authentication when exploited in conjunction with CVE-2025-59358. An attacker with network access to the Kubernetes cluster can craft malicious requests targeting the vulnerable cleanIptables mutation endpoint. The injected commands execute in the context of the Chaos Controller Manager, which typically has broad permissions within the cluster.
The attack chain involves:
- Leveraging CVE-2025-59358 to bypass authentication controls
- Sending a crafted request to the cleanIptables mutation with malicious payload
- The payload breaks out of the intended iptables command context
- Arbitrary OS commands execute with Chaos Controller Manager privileges
- Attackers can then pivot to other cluster nodes or escalate privileges
For detailed technical analysis and exploitation mechanics, refer to the JFrog security research blog documenting these Chaos Mesh vulnerabilities.
Detection Methods for CVE-2025-59361
Indicators of Compromise
- Unusual process spawning from Chaos Controller Manager pods
- Unexpected network connections originating from Chaos Mesh components
- Suspicious iptables-related log entries containing shell metacharacters or encoded commands
- Anomalous file system modifications within Chaos Controller Manager containers
Detection Strategies
- Monitor Kubernetes audit logs for requests to Chaos Mesh webhook endpoints containing suspicious payloads
- Implement runtime security monitoring to detect command injection patterns in container processes
- Deploy network policy monitoring to identify lateral movement from Chaos Mesh pods
- Use Falco or similar runtime security tools to alert on unexpected shell executions within Chaos Mesh containers
Monitoring Recommendations
- Enable verbose logging for Chaos Controller Manager and forward logs to a SIEM platform
- Configure alerts for any shell command execution within Chaos Mesh pods that deviate from normal operation
- Monitor for reconnaissance activities such as environment enumeration or credential harvesting from cluster resources
How to Mitigate CVE-2025-59361
Immediate Actions Required
- Review the GitHub Pull Request #4702 for patch details and apply the fix immediately
- Audit Kubernetes clusters for Chaos Mesh installations and identify vulnerable versions
- Implement network policies to restrict access to Chaos Controller Manager endpoints from untrusted sources
- Consider temporarily disabling Chaos Mesh if patching is not immediately possible
Patch Information
The Chaos Mesh maintainers have addressed this vulnerability through input sanitization improvements in the cleanIptables mutation handler. Organizations should update to the patched version as referenced in GitHub Pull Request #4702. The fix implements proper input validation and command argument handling to prevent shell metacharacter injection.
Workarounds
- Implement Kubernetes NetworkPolicies to restrict network access to Chaos Controller Manager pods to only trusted namespaces and services
- Deploy admission controllers to validate and reject suspicious payloads targeting Chaos Mesh webhooks
- Enable Pod Security Standards to limit the capabilities of Chaos Mesh components where operationally feasible
- Isolate Chaos Mesh to dedicated namespaces with minimal cluster-wide permissions until patching is complete
# Example NetworkPolicy to restrict Chaos Controller Manager access
kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: chaos-controller-restrict
namespace: chaos-mesh
spec:
podSelector:
matchLabels:
app.kubernetes.io/component: controller-manager
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
chaos-mesh-trusted: "true"
EOF
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


