Skip to content

Redact environment secrets before writing or displaying diagnostic logs #3120

Open

Description

@UBPClaw

Summary

The CMD, PowerShell and Bash diagnostic helpers print every environment variable and persist the results to temporary log files. These logs can include API tokens, cloud credentials, passwords and credential-bearing URLs.

Severity: Medium. Confidence: High for the unredacted logging behavior, confirmed by source inspection at commit 1d6777b5c087c7e31ab9b2a1237276c9fe8a0d3a. Actual disclosure depends on secrets being present and someone obtaining or sharing the output. No real credentials were collected and the diagnostic scripts were not executed during this audit.

Code path

Scenario and impact

A developer runs a diagnostic from a shell containing deployment credentials and attaches the output to a support issue. The credentials are included verbatim. The existing instruction to sanitize output is helpful, but relies on the user finding every sensitive value; it does not prevent secrets from being written to disk first.

Recommended correction

Allowlist the environment variables needed for Cmder troubleshooting and redact sensitive values before either writing logs or displaying output. Avoid printing unknown environment values by default. Keep the sanitization warning as an additional precaution.

Validation to add

Use synthetic sentinel values only: place a fake API token, password and credential-bearing URL in an isolated test environment, run each helper, and assert that none of the sentinels appears in either output or the saved log. Confirm that the allowlisted Cmder diagnostics remain useful.

Existing issues checked

Searches of open and closed issues for cmder_diag, redaction, credentials and secrets found diagnostic troubleshooting threads, but no issue requesting prevention of environment-secret disclosure.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions