k8s-debug
Warn
Audited by Socket on Mar 4, 2026
1 alert found:
SecuritySecurityscripts/pod_diagnostics.py
MEDIUMSecurityMEDIUM
scripts/pod_diagnostics.py
The code is a kubectl-based diagnostic utility that gathers pod, container, and node information. It does not contain obvious backdoors, network-based exfiltration, or obfuscated malicious payloads, but it dangerously constructs shell commands with unvalidated, user-supplied pod and namespace values and uses subprocess.run(shell=True). This yields a high risk of shell command injection. Additionally, writing collected diagnostics to a user-specified file can lead to leakage or overwriting of sensitive files. Fixing requires removing shell=True, using argument lists, validating inputs, and restricting output paths. The provided snippet also contains syntax errors and would not execute as-is.
Confidence: 90%Severity: 70%
Audit Metadata