Repository navigation
Conversation
A bridge request carries the whole ODBC/JDBC connection string, password included, in the `connection_string` query parameter of its URI. The query text masks it as '[HIDDEN]', but the URI was shown as is wherever it is rendered: in the error of a failed bridge request (client, query_log, system.errors, server log), in the ReadWriteBufferFromHTTP/WriteBufferFromHTTP log lines, in system.schema_inference_cache.source after a successful read, and in the remote_url_allow_hosts rejection. With a named collection this discloses a password the user cannot read in system.named_collections. All of these sinks render through maskURICredentials, which knew only the userinfo and the presigned-URL parameters. Add the third carrier there: maskXDBCConnectionStringParameter hides the whole value, because its grammar belongs to the driver. RemoteHostFilter::checkURL composes the maskers by hand, so it calls it too. The parameter-value scan of maskPresignedURLParameters moves unchanged into a template shared by both, and the parameter name becomes a constant of the bridge protocol, used both where it is sent and where it is masked. Masking at render time, not changing the protocol (sending the string in the request body), keeps version-skewed external bridges working, and it is the only layer that reaches system.schema_inference_cache, whose key must keep the connection string. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex): 0 findings. Session id: cron:clickhouse-review-self-slot-58:20261016-061700 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-self-slot-57:20261016-060000 |
|
Workflow [PR], commit [376951a] Summary: ❌
AI ReviewSummaryPR #126223 masks the entire Missing context / blind spots
Final VerdictStatus: ✅ Approve. No review changes required; normal CI checks still apply. |
|
cc @GrigoryPervakov @hanfei1991, could you review this? The ODBC/JDBC bridge request URL carries the connection string, password included, as the |
| /// The whole connection string a bridge request carries is hidden: its grammar belongs to the ODBC or JDBC driver. | ||
| inline bool maskXDBCConnectionStringParameter(std::string & url) | ||
| { | ||
| return maskURIQueryParameterValues(url, [](std::string_view name) { return name == XDBC_BRIDGE_CONNECTION_STRING_PARAMETER; }); |
There was a problem hiding this comment.
Do we actually need new function maskXDBCConnectionStringParameter and maskURIQueryParameterValues?
Looks like we can add a check name == "connection_string" in is_secret_parameter
There was a problem hiding this comment.
Done in 2037d12: both functions are removed, and is_secret_parameter checks name == "connection_string". This also covers the other callers of maskPresignedURLParameters: for example, url('http://h/?connection_string=x') is now logged as connection_string=[HIDDEN] (checked locally). The tests are unchanged and pass (05404 50/50 in the CI image, test_allowed_url_from_config 5/5).
Per review: instead of a separate masker and a bridge-protocol constant, treat `connection_string` as one more secret parameter name in `maskPresignedURLParameters`. `maskURICredentials` and `RemoteHostFilter::checkURL` already call it, so every render of a bridge request URL is covered, and the other callers (e.g. the `url()` argument masking of the query text) hide the parameter too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CI finish ledger - 2037d12Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
The build failure dropped 92 dependent jobs, so no functional test has run on this head yet. Session id: cron:our-pr-ci-monitor:20261016-150006 |
|
clang tidy failed: Please try to fix it in another PR if it is not urelate. and merge master if it is fixed |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units34 translation units recompiled, 179 s compile time in total, 31 of them have a recent master baseline. Median compile-time ratio to the baselines is ×1.08 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
CI finish ledger - d3a9fadEvery failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
#126396 reverts #124131; the first master commit after it ( Session id: cron:our-pr-ci-monitor:20261017-040005 |
|
@groeneai check the CI failure |
…c-connection-string
…n-string Co-Authored-By: Claude Opus 5.5 <[email protected]>
…hout it The stress phase can leave a database-level policy (`ON test_1.* USING 1`, from an interrupted 02703) over a database where another test left a data lake table without files (04894 deletes them in an `EXIT` trap). The row-policy check stopped on that table with `Code: 107 FILE_DOESNT_EXIST`, which is not a filter error, and wrote a false `Cannot check whether the row policies can be applied` FAIL row (seen on ClickHouse#126223). The batched check of all covered tables stays the fast path. When it fails with an analysis error or 107, the tables are checked one by one, with and without the filter: a table that fails the same way without the filter is logged to `unreadable_row_policy_tables.txt` and skipped, a filter that fails on a readable table is classified as before, anything else is a FAIL row. A `DeltaLakeLocal` table without files fails with `Code: 742 DELTA_KERNEL_ERROR` instead of 107 and is handled the same way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@groeneai check the CI please, if not our fault, please merge master |
…c-connection-string # Conflicts: # src/Common/maskURIPassword.h # tests/integration/test_allowed_url_from_config/test.py
|
The red was I merged master (4ce8938) in 376951a, which also resolves the conflict in |
|
Most problems in this PR has been fixed, let's close it |
|
Measured on today's master (41a73de, debug build): the The same cleartext password goes to My previous comment was ambiguous, sorry: the @hanfei1991 should I reopen this PR as it is (the |
|
@groeneai we can open an another PR only fixing |
|
Acknowledged. I'll open a new PR whose code change is only the |
|
Opened #130576: its only code change is the |
Related: #120407
Related: #106442
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The connection string of the
odbcandjdbctable functions and of theODBCandJDBCtable engines, password included, is no longer shown in cleartext in the bridge request URL quoted by errors,system.query_log, the server log andsystem.schema_inference_cache. The query itself already showed it as[HIDDEN].Description
On 26.8.28.14-lts, and on master after #120407, a failed bridge request quotes its URL with the password while the logged query shows
odbc('[HIDDEN]', 'db', 't'):The same URL reaches
system.query_log.exception, the server log,system.schema_inference_cache.sourceafter a successful read, and theremote_url_allow_hostsrejection. With a named collection, a user who cannot readsystem.named_collectionsgets its password this way.The server sends the connection string to the bridge as the
connection_stringquery parameter, andmaskURICredentials, which all these renders call since #120407, masks only the userinfo and the presigned-URL parameters.maskPresignedURLParameters, whichmaskURICredentialsandRemoteHostFilter::checkURLcall, now also hides the whole value ofconnection_string: its grammar belongs to the driver, so the password cannot be located inside it. Its other callers hide it too (for example,url('http://h/?connection_string=...')in the logged query text). The bridge protocol does not change, so older external bridges keep working.05404_xdbc_connection_string_maskedchecks the client error,system.query_logand anODBCengine insert, and a newtest_allowed_url_from_configcase checks the URL rejection; both fail without the change. The test uses a DSN that does not exist, because a read that really connects crashes the external bridge when the flaky check runs the test in parallel; the success path (system.schema_inference_cache) was checked locally against the CI bridge.Workflow [PR]
Sync PR [sync-upstream/pr/126223]