Potential fix for code scanning alert no. 3: Clear-text logging of sensitive information#43
Merged
Michel Edkrantz (MichelEdkrantz) merged 1 commit intomasterfrom Feb 4, 2026
Conversation
…nsitive information Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Michel Edkrantz (MichelEdkrantz)
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Potential fix for https://github.com/annotell/kognic-auth-python/security/code-scanning/3
In general, to fix clear-text logging of sensitive data, you should avoid logging secrets at all, or log only non-sensitive metadata (for example, that credentials were successfully loaded, or the presence/absence of a client ID, but never the secret itself). When output is needed for debugging, you can either omit the sensitive fields or replace them with redacted placeholders.
In this file, the only problematic behavior is in the
__main__block:The single best way to fix this without altering existing functional behavior elsewhere is to stop printing the credentials tuple directly. Instead, we can:
get_credentials_from_env()so that any side effects or validation still occur.client_secret) is never included in the output.A minimal, backward-compatible pattern is:
This preserves the ability to verify that environment variables are wired correctly (client ID visible) while not exposing the secret. No new imports or helper functions are needed, and all changes are localized to the
__main__block insrc/kognic/auth/credentials_parser.py.Suggested fixes powered by Copilot Autofix. Review carefully before merging.