Repository navigation
Reject the file: prefix in time zone names - #13
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]>
This was referenced Sep 21, 2026
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.
CheckTimeZoneNameruns on the raw name, butFileZoneInfoSource::Openstrips thefile:prefix before it builds the path. A name such asfile:/abs/paththerefore passes the leading/check and opens an arbitrary absolute path, which is exactly what the carried "Prevent arbitrary file open while loading timezone" patch is meant to prevent. The prefix is a test-only interface, so reject it outright.Adds regression tests for the previously unchecked forbidden patterns and for the
file:bypass. The new test copies a zone outside of the zoneinfo directory so the rejection is not just a missing file. Verified the test fails without the fix and passes with it; the full suite passes (built with-DCMAKE_CXX_STANDARD=20, since the existingstarts_within this branch already needs C++20).Closes: ClickHouse/ClickHouse#121367
Related: ClickHouse/ClickHouse#121325
🤖 Generated with Claude Code