Repository navigation
Reject malformed timezone data and unsafe zone names - #36
Merged
Merged
Conversation
Empty TZif data and zero variants can abort the parser; unterminated designations can read past the buffer. Reject those inputs, truncated TZif v2 future strings, and unsafe timezone path syntax before opening a file. Keep valid IANA paths and lazy lookup behavior. Verified: focused red-before probes for empty/zero-variant/unterminated and v2 footer inputs; TestTimezone.* 18/18; C++ test binary 747/747 with the pre-existing Linux CONDA_PREFIX backslash test excluded. Windows and customer-package validation remain open.
The ORC main CI format check rejected line wrapping in the timezone guard and tests. Apply the reported clang-format-13 changes without altering non-whitespace content. Verified: git diff --check; Debug ORC main rebuild and TestTimezone.* 18/18 on Chaos Lab. Remaining: CI format rerun and Windows coverage.
Author
|
I compared the failed logs with the unmodified main run (https://github.com/ClickHouse/orc/actions/runs/37810662586). Both runs fail Javadoc while fetching the same missing package-list URLs. The macOS jobs stop at the same snappy_ep configure step, before ORC tests; the underlying Snappy configure error is not in the job log. Linux build/test and formatting pass here. Could you review this main counterpart to #35? |
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.
What changes were proposed in this pull request?
Reject empty TZif input, zero-byte timezone files, TZif headers with no local-time types, unterminated timezone designations, and truncated TZif v2 future strings with
TimezoneError. Validate serialized timezone names before joining them toTZDIR, including lexical traversal, absolute and drive-like paths, empty components, trailing dots or spaces, and Windows device names. Preserve lazy lookup and valid IANA paths.This applies the parser and path guards from the now-merged ClickHouse/2.3.1 PR to ORC
main.Why are the changes needed?
Controlled inputs on the unpatched ClickHouse ORC branch reproduced aborts for empty or zero-type timezone data, an ASan overflow for an unterminated designation, and a relative path that loaded a controlled TZif outside
TZDIR. A valid two-section TZif v2 with a 0- or 1-byte footer threwstd::length_erroron this branch before the guard. The tests target these input boundaries. They do not establish the exact cause in Anthropic's private binary.How was this patch tested?
The isolated Ubuntu build passed
TestTimezone.*18/18, including invalid and valid boundary inputs. With a scratch tzdata overlay containing the missingUS/Pacificalias, the C++ test binary passed 747/747 after excludingTestTimezone.testTzdbFromCondaEnv. A full 748-test run withTZDIRset failed in that existing test because it changesCONDA_PREFIXto Windows backslash syntax on Linux and exits before restoring it; subsequent timestamp tests then inherited the broken variable. The excluded test also passed in the focused suite withTZDIRunset, where its conditional body does not run.git diff --checkpassed. A formatting-only follow-up at9f008cf1rebuiltorc-testand passedTestTimezone.*18/18. The C++ formatter and Ubuntu CI jobs passed on this head.ASan/UBSan on this
mainbuild, Windows CI, downstream ClickHouse integration, and the customer package remain unverified. ClickHouse integration is in ClickHouse#125651, with CI pending. The Javadoc and macOS jobs fail on unmodifiedmainat external setup/download steps; the Windows jobs were cancelled. A separate sanitizer configure stalled at the project's Maven download. The name check is lexical: a pre-existing symlink in an untrustedTZDIRcan still resolve outside that directory.Was this patch authored or co-authored using generative AI tooling?
Generated-by: Codex (GPT-6 Luna Max and GPT-6, 2026-10-13).