Repository navigation
Reject the file: prefix in time zone names (2026d) - #14
Merged
Merged
Conversation
`CheckTimeZoneName` runs on the raw name, but `FileZoneInfoSource::Open` strips the `file:` prefix before it builds the path. A name such as `file:/abs/path` therefore passes the leading `/` check and opens an arbitrary absolute path, which is exactly what the check is meant to prevent. The prefix is a test-only interface, so reject it outright. Add regression tests for the previously unchecked forbidden patterns and for the `file:` bypass, copying a zone outside of the zoneinfo directory so the rejection is not just a missing file. ClickHouse/ClickHouse#121367 Co-Authored-By: Claude Fable 5.1 <[email protected]> (cherry picked from commit ddb2b7d)
thevar1able
added a commit
to actueleai/ClickHouse
that referenced
this pull request
Sep 21, 2026
`CheckTimeZoneName` in the `cctz` fork ran on the raw name, but `FileZoneInfoSource::Open` strips the `file:` prefix before it builds the path, so `file:/abs/path` bypassed the leading `/` check and opened an arbitrary absolute path. The fork now rejects the prefix outright. Add a stateless test for the `file:` bypass and the other forbidden patterns across `toDateTime`, `toTimeZone`, the `DateTime` type parameter and `session_timezone`. Closes: ClickHouse#121367 ClickHouse/cctz#14 Co-Authored-By: Claude Fable 5.1 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #13 onto
ClickHouse/2026d, so that ClickHouse/ClickHouse#121325 can carry the fix.The only conflict was in
time_zone_lookup_test.cc, where upstream 2026d added its own path-traversal tests at the same spot. Both blocks are kept. Full suite passes (4 of 4) with-DCMAKE_CXX_STANDARD=20.Related: ClickHouse/ClickHouse#121367
🤖 Generated with Claude Code