Skip to content

Backport #120407 to 26.3: [SECURITY] Mask credentials embedded in HTTP URIs - #126708

Merged
hanfei1991 merged 2 commits into
26.3from
backport/26.3/120407
Oct 20, 2026
Merged

hanfei1991 merged 2 commits into
26.3from
backport/26.3/120407

Conversation

@robot-clickhouse-ci-1

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #120407
Cherry-pick pull-request #126161

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.3.58.4

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default labels Oct 19, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [bde7143]

Summary: ✅

@hanfei1991

Copy link
Copy Markdown
Member

@groeneai investigate the ci fail

@groeneai

Copy link
Copy Markdown
Collaborator

It is a real failure of the backported test, not flakiness: two of its checks rely on a change that 26.3 does not have.

Both failing checks are about the dictionary definition, not the HTTP code this PR changes:

  • show_create: SHOW CREATE DICTIONARY prints url 'http://leakuser:pwleakprobe9f2a@...' in clear text.
  • the system.query_log check prints the QueryStart/QueryFinish rows of the CREATE DICTIONARY query with the cleartext url.

Every runtime path the backport changes is masked on 26.3 (url_function, url_status_failure, insert_presigned, dictionary_reload, schema_inference_cache, schema_inference_error are all OK).

On master, the url of an HTTP dictionary source is masked in SHOW CREATE and in the query log by #123364: commit ff5ad16 registers url/endpoint as partly secret keys of the http source, and ASTPair::formatImpl / ASTPair::hasSecretParts consult that registry. #123364 is in 26.10, which is why the 26.10 backport #126165 passes, but it is not in 26.9, 26.8 or 26.3. On 26.3, ASTPair (src/Parsers/ASTFunctionWithKeyValueArguments.cpp) hides only password, headers, header and the password inside a uri key, and hasSecretParts does not flag uri/url, so the query is logged as typed.

CIDB: 05212 has 1146 OK and 0 FAIL on master since it merged. The 26.8 (#126710) and 26.9 (#126711) backports fail with exactly the same two checks.

So the 26.3, 26.8 and 26.9 backports need one of:

  1. drop the two dictionary-definition checks (show_create and the system.query_log check) from the backported test, keeping the scope of [SECURITY] Mask credentials embedded in HTTP URIs #120407; or
  2. also backport the dictionary url masking. Declare secret arguments next to each engine instead of in the parser #123364 is a refactor, so on these branches that would be a branch-local change in ASTPair::formatImpl and ASTPair::hasSecretParts.

Without option 2, the cleartext url password of an HTTP dictionary stays visible in SHOW CREATE DICTIONARY and system.query_log on those branches. That is pre-existing there, not introduced by this backport.

@hanfei1991

Copy link
Copy Markdown
Member

We can do option 1, can you remove the tests in this branch?

@groeneai

Copy link
Copy Markdown
Collaborator

I can't push to backport/26.3/120407, so the change is one commit on top of its current head (15856f6f) on my fork: groeneai@afe4ed4

It removes the show_create check and the system.query_log check from 05212_http_uri_credentials_masked (test and reference only). It is a fast-forward of this branch:

git fetch https://github.com/groeneai/ClickHouse fix-05212-backport-26.3-120407
git push origin FETCH_HEAD:backport/26.3/120407

With this PR's amd_release build, the original test fails with the same diff as CI and the edited one passes 5/5 with randomized settings.

The same commit for 26.9 (#126711) is on fix-05212-backport-26.9-120407 (4a07c37), checked the same way. 26.8 is in #126710.

The show_create and system.query_log checks test that the url of an HTTP
dictionary source is masked in the dictionary definition. On master that
comes from #123364, which is not in 26.3, so both checks fail here. The
runtime paths changed by #120407 stay covered.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@hanfei1991
hanfei1991 merged commit b10d52a into 26.3 Oct 20, 2026
36 checks passed
@hanfei1991
hanfei1991 deleted the backport/26.3/120407 branch October 20, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only! pr-bugfix Pull request with bugfix, not backported by default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants