Skip to content

Prevent load_time_zone() path traversal or arbitrary fopen - #353

Merged
derekmauro merged 4 commits into
google:masterfrom
derekmauro:b529540133
Jul 20, 2026
Merged

Prevent load_time_zone() path traversal or arbitrary fopen#353
derekmauro merged 4 commits into
google:masterfrom
derekmauro:b529540133

Conversation

@derekmauro

Copy link
Copy Markdown
Member

FileZoneInfoSource::Open() strips an optional file: prefix and then concatenates the remainder of the zone-name string under TZDIR (or uses it verbatim if absolute) with no canonicalisation or ".." rejection, then calls fopen(path, "rb"). An attacker-controlled zone name like "../../../../../../tmp/evil" escapes TZDIR. "file:/dev/stdin" or any FIFO blocks the calling thread indefinitely.

FileZoneInfoSource::Open() strips an optional file: prefix and then
concatenates the remainder of the zone-name string under TZDIR (or
uses it verbatim if absolute) with no canonicalisation or ".."
rejection, then calls fopen(path, "rb"). An attacker-controlled zone
name like "../../../../../../tmp/evil" escapes TZDIR.
"file:/dev/stdin" or any FIFO blocks the calling thread indefinitely.
Comment thread src/time_zone_info.cc Outdated
Comment thread src/time_zone_lookup_test.cc Outdated
Comment thread src/time_zone_lookup_test.cc
Comment thread src/time_zone_info.cc
Comment thread src/time_zone_info.cc Outdated
Comment thread src/time_zone_info.cc Outdated
Comment thread src/time_zone_info.cc Outdated
Comment thread src/time_zone_info.cc Outdated
@derekmauro
derekmauro merged commit 28dd041 into google:master Jul 20, 2026
13 checks passed
@derekmauro
derekmauro deleted the b529540133 branch July 20, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants