Skip to content

Backport #133828 to 26.3: Mask the key of keyed SipHash functions in logged queries - #133880

Open
robot-clickhouse wants to merge 2 commits into
26.3from
backport/26.3/133828
Open

robot-clickhouse wants to merge 2 commits into
26.3from
backport/26.3/133828

Conversation

@robot-clickhouse

Copy link
Copy Markdown
Member

Original pull-request #133828

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

@robot-clickhouse robot-clickhouse 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 Nov 23, 2026
@clickhouse-gh

clickhouse-gh Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [e8d6837]

Summary: ❌

job_name test_name status info comment
Stateless tests (amd_asan, distributed plan, parallel, 2/2) failure
05871_keyed_siphash_key_masking FAIL cidb

@groeneai

Copy link
Copy Markdown
Collaborator

I can't push to backport/26.3/133828 (my account has read-only access to this repository), so the fix is on my fork as one commit on top of this PR's head. Applying it is a fast-forward:

git fetch https://github.com/groeneai/ClickHouse groeneai/resolve-26.3-backport-133828
git push origin FETCH_HEAD:backport/26.3/133828

(head 736e23e6d42f811a206294c275502c31d8e30a2f)

Same change as for 26.9 in #133883: SecretArgumentsSpec comes from #123364, which is not on 26.3. The commit keeps the 26.3 registrations in FunctionsHashingMisc.cpp and marks the first argument of sipHash64Keyed, sipHash128Keyed and sipHash128ReferenceKeyed as secret in FunctionSecretArgumentsFinder::findOrdinaryFunctionSecretArguments, next to HMAC.

One more difference on 26.3: the test query is unchanged, but its reference had to follow 26.3's EXPLAIN SYNTAX output, which prints one row per line instead of an escaped \n and formats the unkeyed control's tuple as (...) instead of tuple(...). The masked lines are the same as on master.

Validated on this tree with clang-21, debug build: 05871_keyed_siphash_key_masking passes 50 of 50 runs with randomized settings, 11 existing secret-masking tests pass, and EXPLAIN AST, EXPLAIN QUERY TREE and EXPLAIN actions = 1 show [HIDDEN] instead of the key. The official 26.3.63.123 binary prints the key in EXPLAIN SYNTAX.

This branch has not been deployed

No deployments
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.

3 participants