Skip to content

Security: Potential Sensitive Information Exposure in Logging#804

Open
tomaioo wants to merge 1 commit into
databricks:mainfrom
tomaioo:fix/security/potential-sensitive-information-exposure
Open

Security: Potential Sensitive Information Exposure in Logging#804
tomaioo wants to merge 1 commit into
databricks:mainfrom
tomaioo:fix/security/potential-sensitive-information-exposure

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented May 25, 2026

Summary

Security: Potential Sensitive Information Exposure in Logging

Problem

Severity: Medium | File: src/databricks/sql/experimental/oauth_persistence.py:L56

The src/databricks/sql/experimental/oauth_persistence.py file logs token persistence operations at INFO level, including the file path where OAuth tokens are stored. While not the tokens themselves, the file path could be sensitive. More critically, the DevOnlyFilePersistence class stores OAuth tokens (access_token and refresh_token) in plaintext JSON without encryption, which is noted as development-only but still presents a risk if misused in production.

Solution

Add warnings when DevOnlyFilePersistence is instantiated in non-development environments. Consider encrypting the file or using OS keyring services. Reduce log level for persistence operations or ensure no sensitive data is logged.

Changes

  • src/databricks/sql/experimental/oauth_persistence.py (modified)

The `src/databricks/sql/experimental/oauth_persistence.py` file logs token persistence operations at INFO level, including the file path where OAuth tokens are stored. While not the tokens themselves, the file path could be sensitive. More critically, the `DevOnlyFilePersistence` class stores OAuth tokens (access_token and refresh_token) in plaintext JSON without encryption, which is noted as development-only but still presents a risk if misused in production.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
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