Skip to content

Conversation

krrishdholakia
Copy link
Contributor

Title

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

Copy link

vercel bot commented Sep 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
litellm Ready Ready Preview Comment Sep 13, 2025 3:00am

or infer_credential_type_from_environment()
)
verbose_logger.info(
f"For Azure AD Token Provider, choosing credential type: {cred}"

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 3 days ago

The best way to fix the issue is to ensure that no potentially sensitive credential information, including types that indicate secret material is present, are logged in clear text.

  • We should remove or minimize the logging of which credential type is chosen from the line:
    verbose_logger.info(f"For Azure AD Token Provider, choosing credential type: {cred}")
  • If some logging is still desired for operational awareness, it should be redacted or limited (e.g., logging only that a credential was chosen, not the specific type), or log only if a safe setting is explicitly enabled.
  • Change: in litellm/secret_managers/get_azure_ad_token_provider.py, remove or replace line 76-78 so it does not log the value of the credential type.
    • Option 1: Remove the line entirely.
    • Option 2 (if you want to keep some logging): Replace it with a minimal, non-sensitive log such as "Azure AD Token Provider credential type chosen" (no actual value shown).
  • No new imports or methods are needed.

Suggested changeset 1
litellm/secret_managers/get_azure_ad_token_provider.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/litellm/secret_managers/get_azure_ad_token_provider.py b/litellm/secret_managers/get_azure_ad_token_provider.py
--- a/litellm/secret_managers/get_azure_ad_token_provider.py
+++ b/litellm/secret_managers/get_azure_ad_token_provider.py
@@ -73,9 +73,7 @@
         or os.environ.get("AZURE_CREDENTIAL")
         or infer_credential_type_from_environment()
     )
-    verbose_logger.info(
-        f"For Azure AD Token Provider, choosing credential type: {cred}"
-    )
+    # Do not log credential type to avoid disclosing sensitive information.
     credential: Optional[
         Union[
             ClientSecretCredential,
EOF
@@ -73,9 +73,7 @@
or os.environ.get("AZURE_CREDENTIAL")
or infer_credential_type_from_environment()
)
verbose_logger.info(
f"For Azure AD Token Provider, choosing credential type: {cred}"
)
# Do not log credential type to avoid disclosing sensitive information.
credential: Optional[
Union[
ClientSecretCredential,
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.

1 participant