Skip to content

Hide the Azure SAS signature and the lower-case SigV2 session token in masked URLs - #121348

Merged
Algunenano merged 17 commits into
ClickHouse:masterfrom
groeneai:groeneai/mask-azure-sas-signature-parameter
Oct 22, 2026
Merged

Algunenano merged 17 commits into
ClickHouse:masterfrom
groeneai:groeneai/mask-azure-sas-signature-parameter

Conversation

@groeneai

@groeneai groeneai commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #121257
Related: #126229

sig, the HMAC of an Azure shared access signature, was printed in cleartext wherever a URL query is masked by name (url_base, s3_base, format_avro_schema_registry_url, s3/url arguments, S3::URI and remote_url_allow_hosts errors), while the AWS and Google presigned parameters were hidden. The same happened to x-amz-security-token, the lower-case spelling botocore uses for the session token of a SigV2 presigned URL, which was also kept in the base-backup locator written into an incremental backup.

The presigned parameter names were spelled out separately in S3::URI, BackupInfo::removeCredentialsFromS3URL and maskPresignedURLParameters. They now share isPresignedURLParameterName, which matches the X-Amz-/X-Goog- prefixes in any case. maskPresignedURLParameters adds sig and matches names percent-decoded, as the storage endpoint reads them (?%73ig= authenticates like ?sig= against Azurite, ?SIG= does not). presignedURLCredentials, which scrubs echoed credentials from HTTP error bodies, now also covers sig, X-Goog-Signature, GoogleAccessId and the key id in X-Goog-Credential. maskS3URICredentials duplicated maskURICredentials and is removed.

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

The sig parameter of an Azure shared access signature in a URL (url_base, s3_base, format_avro_schema_registry_url, s3 and url arguments, and error messages) is now replaced with [HIDDEN] in system.query_log, system.settings, system.processes and settings profiles, like the AWS and Google presigned parameters. X-Amz-* and X-Goog-* parameters are now hidden in any letter case, so the lower-case x-amz-security-token of a SigV2 presigned URL is no longer shown or kept in the base-backup locator of an incremental backup.


Workflow [PR]
Sync PR [sync-upstream/pr/121348]

Version info

  • Merged into: 26.11.1.591-master (included in 26.11 and later)

groeneai and others added 3 commits September 21, 2026 09:29
maskPresignedURLParameters is the only thing that hides a credential carried
in a URL's query string, and its name set comes entirely from AWS SigV2/SigV4
and the Google signer. Azure puts its credential in the query string just like
a presigned S3 URL does: parseAzureURL moves an Azure URL's query verbatim onto
the account URL precisely because AzureBlobStorage::processURL recovers the SAS
from there. So sig, the HMAC of a shared access signature, reached
system.query_log.query, formatted_query, Settings[...], system.settings,
system.processes and settings profiles in cleartext, while the AWS parameter
beside it in the same string was hidden:

  before: s3('https://b/f.csv?X-Amz-Signature=[HIDDEN]&sig=CANARY', 'CSV')
  after:  s3('https://b/f.csv?X-Amz-Signature=[HIDDEN]&sig=[HIDDEN]', 'CSV')

sig becomes a fifth exact, case-sensitive entry of exact_names, which serves
both callers of the helper (the s3-family url argument, and the url_base /
s3_base / format_avro_schema_registry_url setting values).

Designs considered and rejected, so they are not re-proposed:

* Adding sig to BackupInfo::removeCredentialsFromS3URL as well. That function
  REMOVES parameters from a backup locator that has to stay openable on
  restore, rather than masking a printed one, so adding a name there is a
  functional change with a breakage mode. It is also unreachable for Azure:
  withoutS3Credentials returns early for every engine but S3. The three
  comments that claimed the two sets mirror each other are corrected instead.
* Matching case-insensitively. Azure emits the lowercase spelling, so ?SIG=
  cannot be constructed as a working credential and was never reproduced;
  the case-sensitivity is pinned by test arms instead of coded around.
* Matching sig as a prefix or substring. It would hide ?design=, ?signed= and
  ?sign=. maskSensitiveQueryParameters.cpp already spells out this trap for
  the same name on the HTTP handler path.
* Reusing isSensitiveParameterName from maskSensitiveQueryParameters.cpp. It
  is substring-based over {secret, password, token, credential, signature,
  key}, so it would newly hide ?AWSAccessKeyId= and any ?...key...= in every
  s3 URL, and it would destroy the re2-equivalence property the gtest holds.
* Adding sig to S3::URI's presigned detection. That set decides whether a '?'
  opens a presigned query or a key wildcard, so changing it changes URL
  parsing rather than logging.

Known residuals: ?SIG= and ?%73ig= stay visible. The percent-encoding
asymmetry already holds for every name in the set, because the scan does not
decode.

The dictionary HTTP source and azureBlobStorage's storage_account_url form run
no presigned masker at all, so they leak X-Amz-Signature too. Those are missing
callers rather than a missing name.

The gtest's re2 reference pattern gains the name in the same commit, so the
equivalence test keeps covering it, and sig / SIG / design join the random
differential's token list.

Related: ClickHouse#121257

Co-Authored-By: Claude Opus 5 <[email protected]>
The previous commit added sig to the name set but compared the RAW bytes of a
query parameter's name, and the storage endpoint decodes those bytes before it
authenticates. The two therefore disagreed about what the parameter is called,
so a fully working shared access signature could be delivered under a name the
masker did not recognise and its signature was still printed in cleartext.

Measured against Azurite 3.35 with one valid SAS, varying nothing but the
spelling of the name:

  sig        200 sas-ok        %73ig      200 sas-ok
  SIG        403 AuthFailure   s%69g      200 sas-ok
  Sig        403 AuthFailure   %73%69%67  200 sas-ok
  %53IG      403 AuthFailure

This supersedes the previous commit's "?SIG= and ?%73ig= stay visible" note.
Both halves of that table are now load-bearing:

* The encoded lowercase spellings authenticate, so they are credentials and are
  hidden. isPresignedURLSecretParameterName tests the raw name first and, only
  when that fails and the name contains a '%', builds a single-pass decoded copy
  and tests that too. The decode is one pass because the endpoint's is one pass,
  so a twice-encoded ?%2573ig= is not sig here and is not a credential there.
* The case variants do NOT authenticate, so ?SIG=, ?Sig= and ?%53IG= stay
  readable. That is the only remaining residual, and it is now a measurement
  rather than an assumption: the earlier commit rejected case-insensitivity as
  unmeasured hardening, and the 403s confirm the ruling.

Only percent escapes are decoded. maskSensitiveQueryParameters also maps '+' to
a space because HTMLForm::readQuery does, but that is ClickHouse's own HTTP
handler, not the Azure client, and ?s+ig= was never measured to authenticate.
That difference from the sibling is named in the code.

A name with no '%' allocates nothing: the guard precedes the only std::string in
the function. Removing it costs 24% on a URL with 21 percent-free parameters
(200k iterations, -O2, 211 ms against 262 ms).

Of the four classifiers that answer this question, this was the only one that
could have the defect, because it is the only one that scans the string itself
instead of reading names through a URI parser:
maskSensitiveQueryParameters decodes its own names, while
BackupInfo::removeCredentialsFromS3URL and S3::URI both take theirs from
Poco::URI::getQueryParameters(), which decodes each name before returning it
(base/poco/Foundation/src/URI.cpp:385). Neither is changed.

The name-set test moved verbatim out of the lambda into
matchesPresignedURLCredentialName so that the decoded name can be tested with
the same predicate and no lambda is nested inside another. No caller changes.

Tests: the re2 differential cannot decode, so its presigned leg is narrowed to
names with no percent escape and given a presigned_comparisons ==
url_corpus.size() assertion, which keeps the narrowing from hollowing it out
(all 46 corpus inputs are still compared, none carries a '%'). The encoded
behaviour gets its own absolute-oracle table covering partial, full, double,
malformed, truncated, uppercase-decoding and '+' spellings, and the prefix
family as well as the exact family. 05056_settings_secret_masking gains one
appended end-to-end arm.

Related: ClickHouse#121257

Co-Authored-By: Claude Opus 5 <[email protected]>
Delete the two lead-ins and the two rationale lines that narrate the new code (the <cctype> note repeats the one this header already carries at :88-89 with its reason); compress the decode property to three lines and the sibling-set note to one; drop the two now-tautological pointers to maskPresignedURLParameters in FunctionSecretArgumentsFinder.
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-follow-up PR origin: groeneai's own out-of-scope finding during its PR work labels Sep 21, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Pre-publication review by an independent model (engine: codex; 2 findings across 2 passes;
bounded: 1 full pass + 1 fix round + 1 delta recheck).

# Sev Finding Verdict Evidence / action
1 ❌ The parameter name is classified on its raw bytes, so a percent-encoded spelling of sig bypasses masking (src/Common/maskURIPassword.h) AGREE, fixed @ 157ce84 The storage endpoint decodes a name before authenticating: ?%73ig=, ?s%69g= and ?%73%69%67= each carried a working SAS (Azurite 3.35, one valid signature, only the spelling varied: HTTP 200 for all three) and logged its value verbatim, while ?SIG=, ?Sig= and ?%53IG= returned 403, so the match stays case-sensitive. The name is now classified on its single-pass decoded form; a name with no % keeps the allocation-free path
2 ❌ An Azure SAS still reaches the log through azureBlobStorage's URL form and through url(...), so the fix is incomplete (src/Parsers/FunctionSecretArgumentsFinder.cpp) DISAGREE Both sites are real leaks, and neither classifies a parameter name at all, so the name set this PR changes cannot reach them: maskAzureConnectionString wraps its whole body in if (!url_arg.starts_with("http")) (:576) and findURLSecretArguments applies only maskURIPassword (:649-653). They print the AWS and Google presigned parameters in cleartext today as well, identically before and after this diff, so dropping "sig" would not change one byte of their output (measured on pristine master 688ee332dbe7). Missing callers, tracked by issue #121257 (assigned to me) and already being added by PR #120407; the dependency runs the other way round, since a caller added there hides an Azure SAS only once the helper knows the sig name
3 💡 The re2 differential's random-string leg skips inputs containing % without asserting that the skip never fires, unlike the corpus leg noted, not blocking The guard is inert today: no token in the generator spells a percent escape, and both differential tests are green on the before binary as well as the after one. The corpus leg does carry the tripwire, presigned_comparisons == url_corpus.size(), with 46 of 46 inputs compared
4 💡 Percent-decoding of a parameter name now exists twice in src/Common noted, not blocking Deliberate, and named in the code: the sibling reads + as a space because HTMLForm::readQuery does, which is this server's own HTTP handler rule rather than the storage client's

Severity: ❌ blocker / ⚠️ major / 💡 nit. DISAGREE verdicts carry recorded evidence and are
terminal per finding. Findings on hunks unchanged by the fix round are auto-dropped.

Also noticed and not raised: nats_url and rabbitmq_address run only the userinfo masker, but the
credential in an AMQP or NATS endpoint is the userinfo password, which is hidden. EXPLAIN AST
prints the unmasked literal in its own result rows, which is pre-existing and returns the author's
own input to the author.

Session id: cron:clickhouse-review-slot-8:20260921-122500

@clickhouse-gh clickhouse-gh Bot closed this Sep 21, 2026
@clickhouse-gh clickhouse-gh Bot reopened this Sep 21, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? Yes, two, neither timing- nor randomization-dependent: tests/clickhouse-test 05056_settings_secret_masking and unit_tests_dbms --gtest_filter='MaskS3URLCredentials*'.
b Root cause explained? maskPresignedURLParameters answers "is this query parameter a credential?" from a list transcribed from the AWS and Google signers, and it answers it from the RAW name bytes. Azure carries its credential in the query string too, so sig reached the same sinks through the same helper unrecognised; and the endpoint percent-decodes a name before authenticating it, so even after adding sig a working signature could arrive as %73ig and still be printed.
c Fix matches root cause? Yes: the missing name is added to the set that owns the question, and the question is asked of the same form the endpoint authenticates. No caller, sink, setting, bound or guard changes.
d Test intent preserved / new tests added? Both. The re2 differential is narrowed to where its claim still holds (re2 cannot decode) and given a presigned_comparisons == url_corpus.size() assertion so the narrowing cannot hollow it: all 46 corpus inputs are still compared. The encoded behaviour gets its own absolute-oracle table of 10 arms, and 05056 gains an appended end-to-end arm with nothing renumbered.
e Both directions demonstrated? Yes, Build-ID asserted on both binaries and on the server that answered. Before: gtest 7 passed / 1 failed on exactly the five arms that must mask, 05056 row 0 0. After: gtest 8 passed, 05056 [ OK ].
f Fix is general across code paths? Yes, and the reason the gap was local is structural: of the four classifiers, this is the only one that scans the string itself rather than reading names through a URI parser. BackupInfo::removeCredentialsFromS3URL and S3::URI both take names from Poco::URI::getQueryParameters(), which decodes them first (verified at base/poco/Foundation/src/URI.cpp:385), so neither can have this defect. Both callers of the fixed helper get it without changing.
g Fix generalizes across inputs? No type dimension exists for a string_view name comparison. The name-text matrix covers partial (s%69g), full (%73%69%67), uppercase-decoding (%53IG), double (%2573ig), malformed (%7Xig), truncated (%7) and + spellings, and exercises the decode on the prefix family (%58-Amz-Signature) as well as the exact family (%53ignature), so it is shown to serve all five names and both prefixes.
h Backward compatible? Nothing to break: no setting, no default, no SettingsChangesHistory entry, no serialization format, no on-disk state, no request path. Masking is display-only, on a caller-local copy under show_secrets, and nothing parses masked output back.
i Invariants and contracts preserved? Yes. The decoder never throws (a malformed or truncated escape is copied through verbatim), never reads out of range (an off-by-one in its bound is caught by a named arm, ?%7=, which aborts under the build's hardened element access), and never rewrites the name, so every expectation keeps the encoded spelling. The surrounding one-pass build, the ?& scan and the copied == 0 early return are untouched.

Session id: cron:clickhouse-impl-slot-6:20260921-105900

@clickhouse-gh

clickhouse-gh Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c838a0d]

Summary: ✅


AI Review

Summary

The PR masks Azure SAS signatures and case variants of AWS/GCS query parameters, shares S3 parameter classification with backup metadata redaction, and extends HTTP error credential scrubbing. No actionable findings remain at head c838a0d03eff40b3640dbb7a4eddf995f189a2ae. The prior resolved backup comment does not warrant reopening: S3::URI treats sig as object-key content, so removing it would change the backup location. The current head passes 05136_presigned_url_setting_masking and 05404_http_error_body_presigned_credentials_scrubbed in the Fast test report.

Final Verdict

✅ Approve.

@clickhouse-gh clickhouse-gh Bot added the pr-bugfix Pull request with bugfix, not backported by default label Sep 21, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Commit c838a0d03eff40b3640dbb7a4eddf995f189a2ae was not compared: the CI logs cluster did not answer (exception 241, code 500: { "meta": [ { "name": "file", "type": "LowCardinality(String)" …).

See the job log for details.

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - b02401f

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
BuzzHouse (arm_asan_ubsan) / RWLockImpl::getLock(): RWLock is already locked in exclusive mode (STID 2043-36a4) logical error, not a crash: a database-wide TRUNCATE re-enters the exclusive lock through an Alias table. 6 distinct pull requests plus 1 true-master run carry this signature today, so it is not specific to this change #121134 (mine, open)

Mergeable Check and the PR rollup name that BuzzHouse shard as the gating failure, so they
carry the same owner. Build profile diff is green on this head ("No significant changes vs
master fb63964"). The 172 CANCELLED entries recorded against this sha are one superseded
earlier run rather than results, and the Finish Workflow / Post Hooks row written while the
run was still in flight has since re-reported success.

Session id: cron:our-pr-ci-monitor:20260921-200127

@clickhouse-gh clickhouse-gh Bot added the comp-object-storage Object storage connectivity (S3/GCS/Azure) including credentials, retries, multipart, etc. label Sep 22, 2026
groeneai and others added 3 commits October 9, 2026 12:53
ClickHouse#123364 moved the S3 secret-argument code out of `src/Parsers/FunctionSecretArgumentsFinder.{cpp,h}`
into `src/Storages/ObjectStorage/S3/S3SecretArguments.cpp`, so the two "mirrors
`BackupInfo::removeCredentialsFromS3URL`" sentences this branch corrected are now dropped there.
`maskPresignedURLParameters` takes master's `HIDDEN_SECRET` placeholder.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…on messages

`S3::URI` folds a query that is not a presigned one into the key, and `Poco::URI::toString`
re-encodes the decoded path, so `?%73ig=...` renders as `?%2573ig=...`. `maskedURIString` and
`RemoteHostFilter::checkURL` undid only the `%3F`, so `maskPresignedURLParameters`, which decodes a
name once, saw `%73ig` and the signature reached the `Invalid S3 key` and `UNACCEPTABLE_URL` messages
in clear while the key half of the same message was masked. Undo the `%25` too, after the `%3F`, so
a `%253F` written in a key does not turn into a separator.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`Poco::URI::toString` appends a raw query as is, and a query folded into an S3 path leaves none, so
the `%25` undo now runs only when there is no raw query: a URL that kept its query is shown as
written (`?foo=%25bar` stays) and a name like `%2573ig` keeps the single decoding pass.

The `Invalid S3 key` row in `05256` cannot reach `RemoteHostFilter::checkURL` (the key is rejected
first), so `test_allowed_url_from_config` gains the encoded `?%73ig=` case for the host-filter error.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread src/Common/maskURIPassword.h Resolved
@groeneai

groeneai commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - ca3d9a3

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (arm_binary, s3 storage, DBReplicated, parallel, 1/2) / 05316_secret_arguments_declared_by_engines not from this PR: the test came with #123364 (merged today), and under DatabaseReplicated its last query_log check counts the CREATE DICTIONARY row twice (0 2 instead of 0 1; the password stays hidden). 21/21 reruns pass; 139 PRs show it in this lane today #124928 (external, merged 17:58Z). This run was dispatched at 14:09Z, before that merge, so I will merge master here to pick it up
Mergeable Check, PR praktika rollups of the row above (Failed: Stateless tests (arm_binary, s3 storage, DBReplicated, parallel, 1/2)) #124928 (external, merged)
Sync - CH Inc sync (private, not actionable by me)

Both Bugfix validation (integration tests, *) jobs and both Bugfix validation (functional tests, *) jobs passed: the changed tests fail on master and pass here.

Session id: cron:our-pr-ci-monitor:20261009-200011

…-sas-signature-parameter

Kept master's new `RemoteHostFilter::checkURL(uri, throw_on_error)` structure and applied the PR's `%25` unescaping for an S3 URI query folded into the path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
groeneai and others added 4 commits October 17, 2026 05:01
…case

`maskPresignedURLParameters` compared the `X-Amz-` and `X-Goog-` prefixes
case-sensitively. They are header names hoisted into the query, and
botocore's SigV2 presigning (`signature_version='s3'`) lower-cases every
`x-amz-*` header into it, so a URL presigned with temporary credentials
carries `x-amz-security-token=<STS token>`. Every sink that masks URLs
through this helper printed it verbatim, while the canonical
`X-Amz-Security-Token` was hidden. On 26.8.28.14 and
26.9.19.9 the token reached `system.query_log` (`query` and `exception`)
for an `s3()` URL; on master also the `Settings` map for `s3_base` and the
error of a failed `url()` request.

The prefixes now match ASCII-case-insensitively. The exact names keep
matching as spelled: they are query-only names that every signer emits
canonically, and `sig` is case-sensitive on purpose (Azurite rejects
`?SIG=`). The percent-decoded pass goes through the same predicate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`BackupInfo::removeCredentialsFromS3URL` builds the `<base_backup>`
locator that an incremental backup writes into its `.backup` metadata.
It matched `X-Amz-` and `X-Goog-` case-sensitively, so for a SigV2
presigned base URL (`...?AWSAccessKeyId=..&Signature=..&x-amz-security-token=T&Expires=..`)
it removed three names and kept `x-amz-security-token=T`. The STS
session token was persisted in the backup metadata, and the leftover
query is no longer presigned to `S3::URI`, which then reads it as part
of the key: a restore that copies the credentials onto that locator
fails with `Backup S3('.../base?x-amz-security-token=T', ...) not found`.

The `X-Amz-` and `X-Goog-` names are now removed in any case, but only
when the query is presigned by the existing case-sensitive set, because
`S3::URI` ignores the query of a presigned URL only. A query that is
not presigned is part of the key, so `.../backup?x-amz-foo=bar` keeps
its query and still opens the same object on restore.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`S3::URI` reads no key from the query when it carries `versionId` or a
presigned name, but `BackupInfo::removeCredentialsFromS3URL` removed the
`X-Amz-`/`X-Goog-` names in any case only for a presigned query. So
`.../backup?versionId=v1&x-amz-security-token=T` kept the token in the
`<base_backup>` locator written to the backup metadata, although
removing it opens the same key and version (the canonical
`X-Amz-Security-Token` of the same URL was already removed). The gate
now uses the same predicate as `S3::URI`; `versionId` itself is kept.

The `X-Goog-` half of that rule gets a test with a GCS V2 presigned
locator, and a doc sentence in `maskURIPassword.h` no longer claims
that `BackupInfo` skips decoded names (it reads names through
`Poco::URI`, which decodes them).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Drop a comment that narrated the decoder's design, and condense the decoding, regex-equivalence and SAS notes in maskURIPassword.h.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@groeneai groeneai changed the title Hide the Azure SAS signature parameter in masked URLs Hide the Azure SAS signature and the lower-case SigV2 session token in masked URLs Oct 17, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review: adjudication log (click to expand)

Review of the added commits (X-Amz-/X-Goog- names in any case); engine: codex, rounds 1-3.

# Sev Finding Verdict Evidence / action
1 ❌ BackupInfo::removeCredentialsFromS3URL kept the lower-case SigV2 x-amz-security-token in the base-backup locator written into backup metadata AGREE fixed: header-derived names removed in any case once the query is presigned; a query that is part of the key to S3::URI stays
2 ❌ The same, when versionId rather than a presigned name makes S3::URI ignore the query AGREE fixed: the condition is exactly S3::URI's (versionId or a presigned name); versionId itself stays
3 ⚠️ The X-Goog- arm of that condition had no test AGREE fixed: GCS-presigned case added to the same test
4 ⚠️ A non-credential parameter left after stripping (?X-Amz-Signature=S&response-content-disposition=x) is folded into the key on restore DISAGREE pre-existing: only the canonical X-Amz-Signature is removed there, by the master predicate (f45721cd2d28d), so master writes the same locator; this PR only removes more names and never versionId, so no locator that master reopens correctly changes

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @jkartseva, could you review the BackupInfo::removeCredentialsFromS3URL part? It now also removes x-amz-*/x-goog-* names in any letter case from a base-backup locator, only when S3::URI does not read the query as part of the key (a presigned name or versionId is present).

@groeneai

Copy link
Copy Markdown
Collaborator Author

CI finish ledger - c209e5f

Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
whose fixing-PR link will be posted here when it opens. Only CH Inc sync is exempt.

Check / test Reason Owner / fixing PR
Stateless tests (arm_asan_ubsan, azure, sequential, 2/2) / 03821_drop_workload_during_query_race flaky, not from this PR: the test filters the expected error of a query that races DROP WORKLOAD line by line, so the rest of its multi-line stack trace reaches stdout. 0 of 3 reruns fail; about 40 PRs show it in 30 days #126345 (mine, open)
PR praktika rollup of the row above #126345 (mine, open)

All four Bugfix validation (functional tests, *) and Bugfix validation (integration tests, *) jobs passed: the changed tests fail on master and pass here.

Session id: cron:our-pr-ci-monitor:20261017-230009

@Algunenano Algunenano self-assigned this Oct 20, 2026
Algunenano and others added 4 commits October 22, 2026 14:34
…nature-parameter

# Conflicts:
#	tests/integration/test_allowed_url_from_config/test.py
Reuse `decodeQueryComponent` instead of a second percent decoder, keep the
name matcher inside `maskPresignedURLParameters`, drop the no-op `%` skips in
the differential gtests, and check the Azure SAS masking in `05056` with one
`getSetting` query instead of two `query_log` polling loops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`S3::URI`, `BackupInfo::removeCredentialsFromS3URL` and `maskPresignedURLParameters`
each spelled the same list of presigned query parameter names. They now share
`isPresignedURLParameterName`, which matches the `X-Amz-`/`X-Goog-` prefixes in
any case, so the lower-case SigV2 `x-amz-security-token` is handled the same in
all three. `presignedURLCredentials` keeps its narrower list next to it and now
also scrubs the Azure SAS `sig` and the GCS signature and key id.
`maskS3URICredentials` duplicated `maskURICredentials` and is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The container in `abfss://c@...` reads as userinfo and is hidden, which is not what the check is about.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@Algunenano Algunenano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a few tweaks to simplify the code and unify lists of parameters. Looks fine now

Move the `SettingsSecrets.h` masking bodies into the .cpp so including the header does not pull
URL masking into every translation unit, and stub `renderSecretSettingValue` in the WASM build,
which formats with secrets shown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Algunenano
Algunenano added this pull request to the merge queue Oct 22, 2026
Merged via the queue into ClickHouse:master with commit 2b443ad Oct 22, 2026
179 checks passed
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 22, 2026
@clickhouse-gh clickhouse-gh Bot added comp-sql-syntax SQL/grammar parsing, AST nodes, syntax-level features. and removed comp-object-storage Object storage connectivity (S3/GCS/Azure) including credentials, retries, multipart, etc. labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors comp-sql-syntax SQL/grammar parsing, AST nodes, syntax-level features. groeneai-origin-follow-up PR origin: groeneai's own out-of-scope finding during its PR work pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants