Skip to content

docker-compose publishes Postgres and a passwordless Redis on 0.0.0.0 — peering/DB reachable from the LAN by default #421

Closed

Description

@aniruddhaadak80

What happened?

docker-compose.yml (the documented full-stack smoke/dev stack) publishes both stateful services to the host on all interfaces, and Redis runs with no authentication:

# docker-compose.yml (main @ 506bf5c)
  postgres:
    image: postgres:17
    ports:
      - '5433:5432'        # published on 0.0.0.0:5433
    ...
  redis:
    image: redis:7-alpine
    ports:
      - '6380:6379'        # published on 0.0.0.0:6380 — no --requirepass, no ACL, command: absent
    healthcheck:
      test: ['CMD', 'redis-cli', 'ping']

Redis is not a passive cache in this topology — the server comment above it explains it "carries executor peering (cross-replica turn cancel via request-reply)", i.e. live orchestration traffic. With the default compose port publishing:

  1. Anyone on the same network (coffee shop, conference, shared office LAN) can connect to redis://<host>:6380 unauthenticated.
  2. From there they can read/clobber peering traffic (XADD/streams used by the event-subscription registry), flush keys (FLUSHALL) to disrupt running turns, or use the instance as a staging point for the usual exposed-Redis abuse.
  3. Postgres is also reachable if POSTGRES_PASSWORD in .env is weak/default; even without that, exposing a database port beyond loopback is rarely intended.

HOST= defaults exist for the server ("defaults to localhost", per .env.example), which makes the unconditional 0.0.0.0 binding of its backing stores inconsistent with the project's own posture ("Standalone is for local use only... keep it on localhost").

Steps to reproduce

  1. cp packages/trueforge/.env.example packages/trueforge/.env && pnpm dev:infra (or pnpm smoke).
  2. From a second machine on the same network: redis-cli -h <host> -p 6380 ping → PONG, followed by e.g. KEYS agent:* showing live turn streams.
  3. psql -h <host> -p 5433 -U <user> likewise reaches Postgres directly.

Expected behavior

Local-only by default with opt-in exposure:

ports:
  - '127.0.0.1:5433:5432'
  - '127.0.0.1:6380:6379'

and/or a password on Redis (command: ['redis-server', '--requirepass', '${REDIS_PASSWORD}'] + matching REDIS_URL=redis://:${REDIS_PASSWORD}@redis:6379), consistent with the AGENTS.md rule that compose files must keep their intentional differences explicit.

Note the same pattern exists in docker-compose.dev.yml; per repo rules any change must be applied to both files in sync.

How are you running TrueForge?

Docker Compose

Version

main @ 506bf5c

Environment

OS: any host running Docker
Node.js version: n/a (compose stack)

Activity

  1. added a commit that references this issue on Sep 11, 2026
    2d7578e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions