Repository navigation
Conversation
… rejection errors `format_avro_schema_registry_url` may carry Basic-auth credentials in its userinfo and is listed in `SETTINGS_TO_HIDE`, so every setting sink shows `http://[HIDDEN]@host`. Three places still printed the full URL, because they render a `Poco::URI` with `toString()`, which includes the userinfo and the query (where a presigned URL keeps its signature): - the `ConfluentSchemaRegistry` "Fetching schema id = ... from url ..." trace log; - `useSecureConnection` in `HTTPConnectionPool.cpp`: "Unsupported scheme in URI"; - `RemoteHostFilter::checkURL`: "URL ... is not allowed in configuration file", reached by the registry URL on a server and by `url()`, `URL` and the other `checkURL` callers. Mask the rendered string at each site with the existing `maskURIUserinfo` and `maskPresignedURLParameters`. The two errors are fixed in the shared functions rather than at the Avro caller. The request still uses the unmasked URL. The pair is not extracted into a helper here because ClickHouse#120407 adds exactly that helper (`maskURICredentials`) to `maskURIPassword.h`. Measured on master and on 26.8.10.6: the trace line and the unsupported-scheme error print `http://user:password@...`; `checkURL` prints it on master with `remote_url_allow_hosts`. Tests: `05315_avro_schema_registry_url_credentials_masked` (trace log and unsupported scheme, each with a positive control on the masked shape) and `test_allowed_url_from_config::test_rejected_url_credentials_masked` (userinfo, presigned signature, registry URL). Both fail on master and pass with the fix. Review comment: ClickHouse#120407 (comment) Related: ClickHouse#120407 Co-Authored-By: Claude Opus 5.5 <[email protected]>
With `compatibility_s3_presigned_url_query_in_path = 1`, `S3::URI` folds a presigned query into the path, so `toString()` renders its `?` as `%3F` and `maskPresignedURLParameters` did not see the signature; `checkURL` now restores the `?` before the presigned scan, as `S3::maskedURIString` does. Test: a fourth `test_rejected_url_credentials_masked` case, `s3()` with that setting. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…through the AvroConfluent output. 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, 3 rounds) plus my own review.
Severity: ❌ blocker / |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261001-075500 |
|
Workflow [PR], commit [6ec21f6] Summary: ✅
AI ReviewSummaryThis PR masks URI userinfo and presigned-signature query values in the three paths that previously rendered Final Verdict
LLVM Coverage ReportMeasured on commit 6ec21f6.
Changed lines: Changed C/C++ lines covered: 22/22 (100.00%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes5 object files changed (+53.96 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units9 translation units recompiled, 17 s compile time in total, 9 of them have a recent master baseline. |
Related: #120407
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
A password or presigned signature in a URL is no longer printed in clear by the
ConfluentSchemaRegistrytrace log, by theURL ... is not allowed in configuration file, see <remote_url_allow_hosts>error, or by theUnsupported scheme in URIerror. These now showscheme://[HIDDEN]@hostandX-Amz-Signature=[HIDDEN], assystem.query_logalready does forformat_avro_schema_registry_url.Description
Follow-up to review comment #120407 (comment) (the
:178item).On 26.8 (26.8.10.6),
format_avro_schema_registry_url = 'http://user:password@host/'is shown ashttp://[HIDDEN]@host/by every setting sink, yet the password is printed in clear by:ConfluentSchemaRegistry: Fetching schema id = ... from url ...trace log;Unsupported scheme in URI '...'fromHTTPConnectionPool(for example anftp://registry URL);URL "..." is not allowed in configuration file, see <remote_url_allow_hosts>fromRemoteHostFilter::checkURL, which the registry URL reaches on a server, as dourl(),URLand the othercheckURLcallers.Each site printed
Poco::URI::toString(), which includes the userinfo and the query. They now mask the rendered string with the existingmaskURIUserinfoandmaskPresignedURLParametersbefore printing it;checkURLfirst turns%3Fback into?, becausecompatibility_s3_presigned_url_query_in_pathfolds an S3 presigned query into the path (asS3::maskedURIStringdoes). The request itself still uses the unmasked URL. The pair is not extracted into a helper because #120407 adds exactly that helper (maskURICredentials).Tests:
05315_avro_schema_registry_url_credentials_maskedcovers the trace log and the unsupported-scheme error (the latter for userinfo and, through theAvroConfluentoutput, a presigned signature);test_allowed_url_from_config::test_rejected_url_credentials_maskedcovers theremote_url_allow_hostsrejection for userinfo, a presigned signature, the registry URL and an S3 presigned query folded into the path. Both fail on master and pass with the fix.The HTTP 409 path of
registerSchemaand theHTTPCommon.cppitems from the same review build on code that only #120407 adds, so they follow its merge.🤖 Generated with Claude Code
Workflow [PR]
Sync PR [sync-upstream/pr/123226]
Version info
26.10.1.1198-master(included in26.10and later)