T09 · Insecure Skill Coding Practices
- Location
scripts/run-docker.sh:5- Finding
Unencrypted Remote Docker Management Transport
- Content
View full analysis
Vulnerability Details
File Location:
scripts/run-docker.sh:5-12, 95, 212, 291, 386-389, 582
Vulnerability Type: Plaintext transmission of sensitive Docker API traffic
Risk Level: HighVulnerable Code
bash # Resolve proxy URL if [[ -n "${DOCKER_PROXY_URL:-}" ]]; then BASE_URL="${DOCKER_PROXY_URL}" elif [[ -n "${DOCKER_HOST:-}" ]]; then BASE_URL="${DOCKER_HOST/tcp:\/\//http://}" else BASE_URL="http://localhost:2375" fi BASE_URL="${BASE_URL%/}"The resulting URL is used directly for Docker management requests, including general API calls, events, logs, and command execution:
bash response=$(curl "${args[@]}" "${BASE_URL}${path}" 2>&1)bash curl -sf "${BASE_URL}/events?${qs}" | jq -r ' "\(.time | todate) \(.Type) \(.Action) \(.Actor.Attributes.name // .Actor.ID[:12])"'bash curl -sf "${BASE_URL}/containers/${id}/logs?stdout=1&stderr=1&tail=${tail}" | strip_framesbash curl -sf -X POST -H 'Content-Type: application/json' \ -d '{"Detach":false,"Tty":false}' \ "${BASE_URL}/exec/${exec_id}/start" | strip_framesbash curl -sf "${BASE_URL}/services/${name}/logs?stdout=1&stderr=1&tail=${tail}" | strip_framesTechnical Analysis
When
DOCKER_HOSTuses the conventionaltcp://syntax, the script automatically converts it tohttp://. The default endpoint is also plaintext HTTP. The implementation does not enforce TLS for non-loopback hosts and does not provide explicit CA-certificate or mutual-TLS configuration.Consequently, Docker API requests and responses may cross the network without confidentiality or integrity protection. Depending on the proxy permissions, this traffic can contain container environment variables, logs, infrastructure metadata, arbitrary commands submitted through the
execmode, and high-impact lifecycle or pruning requests.The Docker Socket Proxy limits API endpoints but does not itself make plaintext transport secure. Network-path attackers may still obs ...[truncated 1566 chars]
- Remediation
View remediation
Remediation Suggestions
- Require
https://for every non-loopback Docker proxy endpoint and reject remotehttp://URLs by default. - Do not automatically convert
tcp://tohttp://. Require an explicit secure scheme or map remote TCP endpoints to HTTPS only under a documented policy. - Add explicit TLS settings for:
- a trusted CA certificate;
- a client certificate and private key when mutual TLS is used;
- strict hostname verification.
- Never use options that disable certificate verification.
- If plaintext localhost support is necessary, permit it only for validated loopback addresses and Unix-local forwarding.
- Place the proxy on an authenticated, isolated management network and restrict inbound access with firewall rules.
- Keep Docker Socket Proxy endpoint permissions minimal, especially for
EXEC, destructive lifecycle operations, and prune endpoints. - Update
README.mdandSKILL.mdto warn against exposing port 2375 over untrusted networks and to provide a secure TLS deployment example. - Add startup validation that fails closed when a non-loopback endpoint lacks TLS.
- Require
