Skip to content

[Bug]: deployment build logs expose private environment variables #1663

Closed

Description

@hirockstar

Existing issue

  • I have searched the existing issues and found no duplicate.

Problem description

OpenShip's Git-based Docker build logs can expose deployment environment variables in plaintext. The generated Docker RUN command includes inline export KEY='value' assignments, and the full command is streamed to deployment logs.

Private values such as database keys, API keys, storage credentials, webhook secrets, and service-account JSON must never appear in persisted or streamed build output. Logs should show variable names with masked values instead.

No actual credentials are included in this report.

Steps to reproduce

  1. Create a Git-based Next.js deployment using the buildpack/Docker build strategy.
    1. Configure private environment variables for the project.
    1. Trigger a deployment or redeploy.
    1. Open the deployment build logs.
    1. Observe a Docker command containing inline export KEY='value' assignments.
      The issue occurred both on a failed build and on the successful retry; the successful retry still streamed the environment assignments.

Environment

  • OpenShip project: oblien/openship
    • Observed: 2026-11-08
      • Deployment method: Git-based deployment
        • Framework: Next.js
          • Build image: node:24
            • Package manager: Bun
              • Install command: bun install
                • Build command: bun run build
                  • Runtime: Docker
                    • Hosting target: self-hosted VPS

Logs and screenshots

Relevant redacted log shape:

RUN ... export CI='true' ... EXAMPLE_API_KEY='[redacted]' EXAMPLE_DATABASE_SERVICE_KEY='[redacted]' ... && bun install && bun run build

Please do not include real secret values or production environment-variable names in issue comments or logs.

Additional context

Suggested fixes:

  • Redact secret values before persisting or streaming Docker/build output.
    • Avoid serializing inline environment assignments into logged Docker commands; use a non-logged secret mechanism.
      • Ensure deployment detail/log API responses never return plaintext secret values.
        • Add regression tests asserting private values do not appear in logs, metadata, errors, or notifications.
          • Provide a way to purge historical logs containing exposed values.
            • Separate build-time public variables from runtime-only private variables where possible.

Activity

  1. added
    bug
    on Nov 8, 2026
  2. added theissue type on Nov 8, 2026
  3. Hydralerne commented on Nov 8, 2026

    @Hydralerne
    Member

    on it,

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions