Skip to content

🔵 Dev Dockerfiles run as root with an unpinned base image #1116

Description

@Ejirowebfi

Severity: Low · Area: Infra (frontend/Dockerfile.dev, contracts/Dockerfile.dev, docker-compose.yml)

Description

Neither frontend/Dockerfile.dev nor contracts/Dockerfile.dev declares a non-root USER, so both containers run their build/dev tooling as root by default. docker-compose.yml bind-mounts live source into the frontend container (./frontend:/app), and contracts/Dockerfile.dev pins its base image to a mutable, dated tag (rust:1.75-slim) with no digest pin. This is development-only blast radius (these are not the images used for any production deployment, per the README's Vercel/Netlify/static-hosting deployment guidance), but a compromised transitive build dependency (npm ci, cargo build) would still run as root with write access to the bind-mounted host source tree.

Tasks

  • Add a non-root USER directive to both Dockerfile.dev files, with appropriate ownership of working directories.
  • Pin contracts/Dockerfile.dev's base image by digest (rust:1.75-slim@sha256:...) rather than a mutable tag.
  • Confirm hot-reload/volume-mount workflows (CHOKIDAR_USEPOLLING, etc.) still function correctly for a non-root user, adjusting file permissions/ownership in the Dockerfile as needed.

Acceptance Criteria

  • docker compose up -d still functions identically for local development (hot reload, contract building) after the change.
  • Neither container runs its main process as root, verified via docker compose exec <service> whoami.
  • The Rust base image is pinned by digest.

Issue 28 of 30 from the 2026-08 codebase audit tracked in ISSUES.md.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions