offensive-k8s-attacks

Fail

Audited by Gen Agent Trust Hub on Oct 6, 2026

Risk Level: HIGHREMOTE_CODE_EXECUTIONCOMMAND_EXECUTIONDATA_EXFILTRATIONPRIVILEGE_ESCALATIONPERSISTENCEDYNAMIC_EXECUTIONINDIRECT_PROMPT_INJECTIONCREDENTIALS_UNSAFE
Full Analysis
  • [REMOTE_CODE_EXECUTION]: The skill employs a pattern where data fetched from a network endpoint is piped directly into a Python interpreter (e.g., curl -s http://NODE_IP:10255/pods | python3). This presents a vector for arbitrary code execution if the remote content is compromised. Mitigation: Avoid piping unvalidated network output directly into interpreters; use specialized parsing tools with limited capabilities.
  • [PRIVILEGE_ESCALATION]: Detailed instructions are provided for bypassing Kubernetes security boundaries, including pod escapes (hostPID, hostNetwork, hostPath) and exploiting RBAC misconfigurations (wildcard permissions, impersonation). Mitigation: Implement Pod Security Standards (Restricted profile) and follow the principle of least privilege for RBAC policies.
  • [DATA_EXFILTRATION]: The skill describes methods for harvesting sensitive credentials, such as service account tokens, etcd secrets, and cloud IAM credentials from metadata services. Mitigation: Restrict access to sensitive paths, enable encryption at rest for secrets, and use network policies to block access to cloud metadata services from unauthorized pods.
  • [PERSISTENCE]: Instructions are included for establishing long-term access using malicious DaemonSets and abusing Custom Resource Definitions (CRDs). Mitigation: Monitor for unusual DaemonSet deployments and audit CRD creation and modification events.
  • [COMMAND_EXECUTION]: The skill relies on powerful commands (kubectl, nsenter) to interact with the host and cluster. Mitigation: Limit the tools available within container images and use auditing to track the execution of high-risk commands.
  • [INDIRECT_PROMPT_INJECTION]: The skill processes untrusted cluster data through shell pipes and scripts, creating an attack surface where malicious cluster metadata could influence the agent.
  • Ingestion points: Kubernetes API responses via kubectl and curl.
  • Boundary markers: No clear delimiters or safety instructions are used when processing external data.
  • Capability inventory: Includes full cluster API access, host-level command execution, and network operations.
  • Sanitization: Relies on basic JSON parsing without sanitization of data values.
  • Mitigation: Wrap external content in delimiters with explicit warnings and sanitize all data before processing.
  • [CREDENTIALS_UNSAFE]: The skill instructs the agent to access sensitive files like ~/.kube/config and /etc/shadow. Mitigation: Protect sensitive configuration files with strict file permissions and monitor access to system-level secret files.
Recommendations
  • HIGH: Downloads and executes remote code from: http://NODE_IP:10255/pods - DO NOT USE without thorough review
  • AI detected serious security threats
Audit Metadata
Risk Level
HIGH
Analyzed
Oct 6, 2026, 04:11 AM