T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:198- Finding
Writable Host Docker Socket Exposes the Kubernetes Node to Privilege Escalation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is for CI/CD automation, but its required Jenkins template gives build jobs high-impact host Docker access and has ambiguous credential handling, so users should review it carefully before installing.
Install only if you are comfortable with the generated Jenkins jobs having powerful access to the CI worker environment. Prefer a revised version that removes the host Docker socket mount, uses an isolated image builder, accepts only credential IDs rather than raw passwords, and validates or safely renders all Jenkinsfile inputs before pipeline creation.
SKILL.md:198Writable Host Docker Socket Exposes the Kubernetes Node to Privilege Escalation
SKILL.md:225Direct Jenkinsfile Substitution Permits Groovy and Shell Injection
SKILL.md:61Ambiguous Git Password Handling Can Store Credentials in Plaintext
Mounting /var/run/docker.sock into the build container gives the pipeline direct control over the host Docker daemon. Any code executed during clone/build can abuse that socket to start privileged containers, access the host filesystem, escape isolation, or steal secrets from the node, making this especially dangerous in a CI pipeline that builds untrusted or changing source code.
cpu: "4000m"
memory: "8192Mi"
volumeMounts:
- mountPath: "/var/run/docker.sock"
name: "volume-1"
readOnly: false
- mountPath: /root/.m2/settings.xml
Use of hostPath in a Kubernetes agent pod is a privileged workload pattern because it pierces normal pod isolation and exposes host resources directly to the container. Here the mounted resource is the Docker socket, which substantially increases the risk by enabling host-level actions from CI job code and making the skill more dangerous than a typical deployment template.
subPath: settings.xml
volumes:
- name: "volume-1"
hostPath:
path: "/var/run/docker.sock"
- name: config
configMap:
The hostPath volume exposing /var/run/docker.sock is the underlying mechanism that grants host-level Docker control to the pod. In this skill, the socket is embedded in a reusable Jenkins pipeline skeleton, so any generated pipeline inherits a dangerous privilege boundary bypass by default.
volumes:
- name: "volume-1"
hostPath:
path: "/var/run/docker.sock"
- name: config
configMap:
name: jenkins-agent-config
This example pipeline repeats the Docker socket mount, normalizing an unsafe pattern as a recommended implementation. Because the skill automates CI/CD for deployed workloads, compromise of the build step can cascade into malicious image publication and automated rollout to running applications.
cpu: "4000m"
memory: "8192Mi"
volumeMounts:
- mountPath: "/var/run/docker.sock"
name: "volume-1"
readOnly: false
- mountPath: /root/.m2/settings.xml
The sample configuration includes a hostPath mount, which is a privileged Kubernetes pattern and weakens node/pod isolation. In the CI/CD context, this is particularly risky because attacker-controlled repository contents or build commands can leverage that access to compromise the node and downstream deployment pipeline.
name: config
subPath: settings.xml
volumes:
- hostPath:
path: "/var/run/docker.sock"
name: "volume-1"
- configMap:
The example's hostPath declaration again exposes /var/run/docker.sock from the node into the pod, enabling container breakout and host manipulation through the Docker API. Including it in sample code increases the likelihood that users deploy the unsafe configuration unchanged.
subPath: settings.xml
volumes:
- hostPath:
path: "/var/run/docker.sock"
name: "volume-1"
- configMap:
items:
The manifest description is written as a mandatory Chinese-only instruction set and the file provides no option for users to choose another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.
No suspicious patterns detected.