Skip to content

Conversation

Weves
Copy link
Contributor

@Weves Weves commented Sep 16, 2025

Description

[Provide a brief description of the changes in this PR]

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

Summary by cubic

Stop logging the raw credentials_file in LLM model config logs. It’s now masked (like api_key) to avoid exposing sensitive paths.

  • Bug Fixes
    • Mask credentials_file in _safe_model_config when present and non-empty.

Copy link

vercel bot commented Sep 16, 2025

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

Project Deployment Preview Comments Updated (UTC)
internal-search Ready Ready Preview Comment Sep 16, 2025 10:18pm

@Weves Weves marked this pull request as ready for review September 16, 2025 22:14
@Weves Weves requested a review from a team as a code owner September 16, 2025 22:14
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR fixes a security vulnerability by preventing sensitive credential file paths from being exposed in log outputs. The change modifies the _safe_model_config() method in backend/onyx/llm/chat_llm.py to mask the credentials_file field when logging LLM model configurations.

The implementation follows the existing security pattern already established for the api_key field. When a credentials_file is present and non-empty in the model configuration, it gets masked using the mask_string() utility function before being logged. This prevents sensitive file paths (particularly those containing authentication credentials for services like Google Vertex AI) from appearing in debug logs or long-term logging outputs.

The _safe_model_config() method is used throughout the codebase for logging model configurations during various operations (lines 336, 341, 358, 374), making this security fix broadly applicable. The change is minimal, targeted, and maintains consistency with existing security practices in the codebase.

Confidence score: 5/5

  • This PR is extremely safe to merge with virtually no risk of causing production issues
  • Score reflects a simple, well-targeted security fix that follows existing patterns and addresses a clear vulnerability
  • No files require special attention as this is a straightforward security enhancement

Context used:

Rule - Remove temporary debugging code before merging to production, especially tenant-specific debugging logs. (link)

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@Weves Weves merged commit 6c7eb89 into main Sep 16, 2025
53 of 54 checks passed
@Weves Weves deleted the remove-log branch September 16, 2025 22:48
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