Skip to content

Conversation

@roto31
Copy link
Owner

@roto31 roto31 commented Dec 30, 2025

Description

Brief description of changes

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Distribution update

Testing

  • Tested on macOS
  • Tested on Windows
  • Tested on Linux
  • Tested in containers (Docker/Kubernetes)

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Comments added for complex code
  • Documentation updated
  • No new warnings generated
  • Tests pass (if applicable)
  • Install scripts tested (if applicable)

Related Issues

Closes #(issue number)

Screenshots (if applicable)

Add screenshots to help explain your changes.

Additional Notes

Any additional information that reviewers should know.

)
for secret in secrets_found:
env_var = secret.upper().replace(".", "_").replace("-", "_")
logger.warning(f" - {secret} -> Set STREAMTV_{env_var} environment variable")

Check failure

Code scanning / CodeQL

Clear-text logging of sensitive information High

This expression logs
sensitive data (secret)
as clear text.
This expression logs
sensitive data (secret)
as clear text.

Copilot Autofix

AI 7 days ago

In general, to fix clear-text logging of sensitive information, avoid including any data derived from secrets in log messages. Log only high-level, non-sensitive information (e.g., that a secret is misconfigured) and, if necessary, generic identifiers that are not tainted by secret-handling flows.

For this specific case, the minimal, behavior-preserving fix is to change the per-secret warning so it no longer interpolates the secret value (which CodeQL taints) into the message. Instead, we can log only the derived environment variable name, or even a fully generic message. The core functionality here is to tell users to use environment variables instead of config-file secrets; that can be achieved by logging the recommended environment variable names alone.

Concretely:

  • In Config._warn_secrets_in_config, keep building secrets_found the same way.
  • Keep the initial high-level warning at lines 268–271 as-is.
  • Change the loop at lines 272–274 so that:
    • We no longer include secret in the formatted log string.
    • We only mention the environment variable name to set, e.g. " - Set STREAMTV_{env_var} environment variable".
  • This removes tainted data from the log sink while preserving the user guidance.

No new methods or imports are required.

Suggested changeset 1
streamtv/config.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/streamtv/config.py b/streamtv/config.py
--- a/streamtv/config.py
+++ b/streamtv/config.py
@@ -271,7 +271,7 @@
             )
             for secret in secrets_found:
                 env_var = secret.upper().replace(".", "_").replace("-", "_")
-                logger.warning(f"  - {secret} -> Set STREAMTV_{env_var} environment variable")
+                logger.warning(f"  - Set STREAMTV_{env_var} environment variable")
             logger.warning(
                 "See .env.example for a template of all environment variables."
             )
EOF
@@ -271,7 +271,7 @@
)
for secret in secrets_found:
env_var = secret.upper().replace(".", "_").replace("-", "_")
logger.warning(f" - {secret} -> Set STREAMTV_{env_var} environment variable")
logger.warning(f" - Set STREAMTV_{env_var} environment variable")
logger.warning(
"See .env.example for a template of all environment variables."
)
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants