T09 · Insecure Skill Coding Practices
- Location
docker-compose.yml:5- Finding
Redis Exposed on All Host Interfaces with Optional Empty Authentication
- Content
View full analysis
Vulnerability Details
File Location:
docker-compose.yml, lines 5-14
Vulnerability Type: Exposed service with insecure authentication defaults
Risk Level: HighVulnerable Code
yaml redis: image: redis:7.0-alpine container_name: swarm-coordinator-redis restart: unless-stopped ports: - "6379:6379" volumes: - redis-data:/data command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-}Technical Analysis
The Redis service publishes port 6379 on every host interface. At the same time,
REDIS_PASSWORDdefaults to an empty value. Consequently, the deployment does not enforce a mandatory Redis credential.Depending on how the deployed Redis version processes the empty
--requirepassargument, the service may either operate without meaningful authentication or fail to start. If it operates without authentication, network access to the host is sufficient to access the coordination broker. Redis also stores persistent data through theredis-datavolume.Attack Path
- An attacker identifies a host running the supplied Compose deployment.
- The attacker connects to TCP port 6379, which is published on all interfaces.
- Because a non-empty password is not mandatory, the attacker attempts an unauthenticated connection or uses the empty configured credential.
- The attacker enumerates data, inspects coordination state, or publishes forged messages to known swarm channels.
- Components trusting Redis messages process attacker-controlled coordination data.
Impact Assessment
A reachable attacker may obtain read and write access to the swarm message broker. This can enable disclosure of coordination data, forged task publication, workflow disruption, message injection, and manipulation of persistent Redis state. The scope includes all applications sharing this Redis instance.
- Remediation
View remediation
Remediation Suggestions
- Remove the Redis host-port mapping when only Compose services require access.
- If host access is necessary, bind it explicitly to loopback, such as
127.0.0.1:6379:6379. - Require a non-empty secret using
${REDIS_PASSWORD:?REDIS_PASSWORD is required}. - Configure Redis ACLs with separate, least-privileged application users.
- Use TLS when Redis traffic crosses an untrusted network.
- Restrict access with host and cloud firewall rules.
- Modify the health check to authenticate with the configured Redis credential.
- Avoid placing credentials directly in process arguments where platform-level secret injection is available.
