sec: Dockerfile.dev base image not digest-pinned · Issue #421 · LeanerCloud/cloud-commitments-cli · GitHub
Skip to content

sec: Dockerfile.dev base image not digest-pinned #421

Closed

Description

@cristim

Summary

Dockerfile.dev uses golang:1.25.4-alpine3.21 as its base image without a SHA256 digest pin. The production Dockerfile is correctly pinned to a digest for all three stages. The dev Dockerfile even has a TODO comment acknowledging this:

# TODO: Pin to SHA256 digest for reproducible builds:
FROM golang:1.25.4-alpine3.21 AS development

Risk

While the dev image is not used in production, it is used by all developers running the local dev environment and in any CI steps that build or test against the dev image. A compromised Docker Hub account or a malicious image with the same tag could introduce backdoors into developer workstations or exfiltrate secrets from the dev environment.

Remediation

Follow the same pattern as the production Dockerfile:

# Before
FROM golang:1.25.4-alpine3.21 AS development

# After (refresh digest via: docker pull golang:1.25.4-alpine3.21 && docker inspect --format='{{index .RepoDigests 0}}' golang:1.25.4-alpine3.21)
FROM golang:1.25.4-alpine3.21@sha256:<digest> AS development

Remove the TODO comment once pinned.

References

  • Dockerfile.dev:1
  • Dockerfile - correctly pinned production example

Activity

  1. added 2 commits that reference this issue on Jun 19, 2026
    8b8a519
    dbe3f4a
  2. added 4 commits that reference this issue on Jul 10, 2026
    bb94d98
    7ba24e4
    910da95
    e1e1004
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