Skip to content

Fix: fix Credential leak in query_log for paimon*Cluster and deltaLakeS3 t… - #100529

Merged
alexey-milovidov merged 6 commits into
ClickHouse:masterfrom
JiaQiTang98:fix-credential-leak
Apr 26, 2026
Merged

alexey-milovidov merged 6 commits into
ClickHouse:masterfrom
JiaQiTang98:fix-credential-leak

Conversation

@JiaQiTang98

@JiaQiTang98 JiaQiTang98 commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fix credential leak in query_log for paimonCluster, paimonS3Cluster, paimonAzureCluster, and deltaLakeS3 table functions.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Backported to: 26.4.5.106, 26.3.17.26, 25.8.29.9

@clickhouse-gh

clickhouse-gh Bot commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3179c97]

Summary: ✅


AI Review

Summary

This PR extends query-log secret masking to include deltaLakeS3, deltaLakeS3Cluster, paimon*, and paimon*Cluster table functions. The core masking wiring in FunctionSecretArgumentsFinder looks correct, but test gating is incomplete: new paimonAzure / paimonAzureCluster checks are conditionally skipped when paimonS3 / paimonS3Cluster are unavailable. Verdict: request changes to keep coverage valid across feature matrices.

Findings

⚠️ Majors

  • [tests/integration/test_mask_sensitive_info/test.py:488,562,704,753,791] paimonAzure and paimonAzureCluster coverage is gated by paimonS3 / paimonS3Cluster availability. On builds where Azure is enabled but S3 is not, these masking checks are skipped, so regressions can pass undetected.
    • Suggested fix: gate Azure cases independently using availability checks for paimonAzure and paimonAzureCluster.
Tests
  • ⚠️ Split feature flags in tests: keep S3-related paimon* cases under paimonS3 checks, but gate Azure-related cases under paimonAzure checks (and similarly for cluster variants). This is needed so masking assertions execute on mixed feature builds.
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ⚠️ Test gating currently misses Azure-only builds
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    • Gate paimonAzure and paimonAzureCluster masking test cases independently from paimonS3/paimonS3Cluster availability.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Mar 24, 2026
(function ->name() == "icebergS3Cluster") || (function ->name() == "icebergCluster"))
(function ->name() == "icebergS3Cluster") || (function ->name() == "icebergCluster") ||
(function ->name() == "paimonCluster") || (function ->name() == "paimonS3Cluster") ||
(function ->name() == "paimonHDFSCluster"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

paimonHDFSCluster has HDFS-style arguments (cluster, uri, [format], [structure], [compression_method]), but this branch routes it through findS3FunctionSecretArguments. That parser assumes S3 signatures and may mask non-secret positional args (for example structure/compression) in query_log, which is a behavioral regression for observability.

Please remove paimonHDFSCluster from the S3 branch and handle it with an HDFS-specific rule (or no positional masking if there is no secret argument for this function).

def test_table_functions():
password = new_password()
has_delta_lake = int(node.query("SELECT count() FROM system.table_functions WHERE name = 'deltaLake'").strip()) > 0
has_paimon = int(node.query("SELECT count() FROM system.table_functions WHERE name = 'paimonS3'").strip()) > 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This gate ties all paimon* coverage to paimonS3 availability. paimonAzure can be available without paimonS3 (e.g. Azure-enabled build without S3), so this skips the new masking checks for paimonAzure and can hide regressions.

Please gate each family independently (paimonS3-based cases by paimonS3, paimonAzure-based cases by paimonAzure) to keep coverage valid across build feature matrices. The same pattern appears in test_table_functions_object_storage_cluster.

@tiandiwonder tiandiwonder self-assigned this Mar 24, 2026

@tiandiwonder tiandiwonder left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

changlog:
Fix credential leak in query_log for paimonCluster, paimonS3Cluster, paimonAzureCluster, and deltaLakeS3 table functions.

@JiaQiTang98

Copy link
Copy Markdown
Contributor Author

changlog: Fix credential leak in query_log for paimonCluster, paimonS3Cluster, paimonAzureCluster, and deltaLakeS3 table functions.

Done

@alexey-milovidov

Copy link
Copy Markdown
Member

The Stress test (arm_msan) failure is fixed by #101239, which should be merged first. After it is merged, please update the branch to include the fix.

@clickhouse-gh

clickhouse-gh Bot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.00% 84.00% +0.00%
Functions 90.90% 90.90% +0.00%
Branches 76.50% 76.50% +0.00%

Changed lines: 100.00% (15/15) · Uncovered code

Full report · Diff report

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Apr 26, 2026
Merged via the queue into ClickHouse:master with commit d5250f3 Apr 26, 2026
161 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 26, 2026
@hanfei1991 hanfei1991 added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Jul 6, 2026
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Jul 6, 2026
tiandiwonder added a commit that referenced this pull request Jul 7, 2026
Backport #100529 to 26.4: Fix: fix Credential leak in query_log for paimon*Cluster and deltaLakeS3 t…
tiandiwonder added a commit that referenced this pull request Jul 7, 2026
Backport #100529 to 26.3: Fix: fix Credential leak in query_log for paimon*Cluster and deltaLakeS3 t…
alexey-milovidov added a commit that referenced this pull request Jul 7, 2026
Apply the credential-masking fix on top of the 25.8 release branch:
- Add `deltaLakeS3` to the ordinary s3 secret-argument list (this table
  function exists in 25.8 and its credentials were previously leaked into
  query_log).
- Add `paimonCluster`, `paimonS3Cluster`, and `paimonAzureCluster` to the
  cluster masking lists (forward-compatible; these functions do not exist
  in 25.8 yet, so the comparisons are harmless).
- Add a `deltaLakeS3` test case to test_mask_sensitive_info.

The `paimon`/`paimonS3` ordinary functions and `deltaLakeS3Cluster`/
`icebergCluster`/`deltaLakeAzureCluster` entries present on master are not
introduced here, since they come from other changes that were not
backported to 25.8.

Original pull-request: #100529

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
robot-ch-test-poll3 added a commit that referenced this pull request Jul 7, 2026
Cherry pick #100529 to 25.8: Fix: fix Credential leak in query_log for paimon*Cluster and deltaLakeS3 t…
robot-clickhouse added a commit that referenced this pull request Jul 7, 2026
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jul 7, 2026
hanfei1991 added a commit that referenced this pull request Jul 8, 2026
Backport #100529 to 25.8: Fix: fix Credential leak in query_log for paimon*Cluster and deltaLakeS3 t…
@michael-anastasakis michael-anastasakis added v25.12-must-backport v26.2-must-backport and removed pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore labels Jul 15, 2026
@robot-ch-test-poll robot-ch-test-poll added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Jul 15, 2026
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Aug 24, 2026
…_log for paimon*Cluster and deltaLakeS3 t…
kewin-robetti pushed a commit to viasoftkorp/ClickHouse that referenced this pull request Aug 24, 2026
…_log for paimon*Cluster and deltaLakeS3 t…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-bugfix Pull request with bugfix, not backported by default pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo v25.12-must-backport v26.2-must-backport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants