Repository navigation
Mask the key of keyed SipHash functions in logged queries - #133828
Conversation
`sipHash64Keyed`, `sipHash128Keyed` and `sipHash128ReferenceKeyed` were registered without a `SecretArgumentsSpec`, so the key (the first argument) was written in plain text to `system.query_log` and shown by `EXPLAIN SYNTAX`. A user with `SELECT` on `system.query_log` could read the key of another user and reverse the hashes of enumerable inputs. Mark the first argument as secret, the same way `HMAC` does for its key, so it is formatted as `'[HIDDEN]'`. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Workflow [PR], commit [5b350ae] Summary: ❌
AI ReviewSummaryThe PR registers the first argument of all three keyed SipHash functions as secret and adds a passing Fast Test regression for inline keys. Two remaining key-disclosure paths were reproduced with the PR-head binary, so the stated protection against readers of Findings❌ Blockers
Tests
Final VerdictStatus: ❌ Block Close the alias-definition and index-diagnostic disclosure paths and add focused regression coverage. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes4 object files changed (+84.94 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 units7 translation units recompiled, 12 s compile time in total, 7 of them have a recent master baseline. |
|
@clickhouse-gh Check again |
Backport #133828 to 26.10: Mask the key of keyed SipHash functions in logged queries
Backport #133828 to 26.11: Mask the key of keyed SipHash functions in logged queries
Backport #133828 to 26.8: Mask the key of keyed SipHash functions in logged queries
Backport #133828 to 26.9: Mask the key of keyed SipHash functions in logged queries
sipHash64Keyed,sipHash128KeyedandsipHash128ReferenceKeyedwere registered without aSecretArgumentsSpec, so the key (the first argument) was written in plain text tosystem.query_logand shown byEXPLAIN SYNTAX. A user withSELECTonsystem.query_logcould read the key of another user and reverse the hashes of enumerable inputs.Mark the first argument as secret, the same way
HMACdoes for its key, so it is formatted as'[HIDDEN]'.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The secret first key argument of "keyed" SipHash SQL functions is now masked in
system.query_log.Workflow [PR]
Sync PR [sync-upstream/pr/133828]
Version info
26.12.1.329-master(included in26.12and later)26.11.1.2939,26.10.12.7,26.9.39.7,26.8.47.4