Skip to content

OWASP A03:2021 Injection experiment for Kubernetes security testing#106

Open
r3k2 wants to merge 6 commits intoOperantAI:mainfrom
r3k2:owasp-a03-injection
Open

OWASP A03:2021 Injection experiment for Kubernetes security testing#106
r3k2 wants to merge 6 commits intoOperantAI:mainfrom
r3k2:owasp-a03-injection

Conversation

@r3k2
Copy link
Copy Markdown

@r3k2 r3k2 commented Sep 8, 2025

New OWASP A03:2021 Injection experiment for Kubernetes security testing

Tests included:

  1. K8s API injection - Path traversal in resource names/labels
  2. Ingress annotation injection - Command injection in nginx/ALB annotations
  3. Service selector injection - Malicious values in service selectors
  4. RBAC name injection - Path traversal in role/binding names
  5. ConfigMap key injection - Path traversal in ConfigMap keys

r3k2 added 6 commits August 18, 2025 21:17
  Tests if malicious code can be injected and executed via ConfigMaps.
  Attackers could use this to escalate privileges or exfiltrate data from pods that mount untrusted ConfigMaps.
  - Remove hardcoded script content from Go implementation
  - Make all parameters required (scriptContent, mountPath, targetCommand)
  - Clean up YAML example to be more concise and professional
- Implements OWASP Top 10 A01:2021 vulnerability testing
- Tests RBAC bypass attempts across namespaces
- Verifies if pods can access secrets/configmaps in restricted namespaces
- Adds OWASP framework to categories
- Creates minimal service account to test access controls
- Add OWASP reference URL and timestamps
- Enhance logging to show actual kubectl commands executed
- Add summary section with test completion info
- Improve description for better user understanding
- Tests real injection vulnerabilities in K8s API, Ingress annotations, RBAC names, and ConfigMap keys
- Validates EKS cluster security against path traversal, command injection, and resource name injection
- Found critical vulnerability: Ingress controllers accept command injection in annotations
- Found moderate vulnerability: RBAC allows path traversal patterns in role names
- Confirmed EKS properly blocks injection in ConfigMap keys and Service selectors
- No container dependencies - tests cluster infrastructure directly
- Provides detailed vulnerability reporting like original experiments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant