CVE-2022-31163 json
TZInfo relative path traversal vulnerability allows loading of arbitrary files
published 2022-07-21 4 y ago modified 2026-06-17 4 mo ago also GHSA-5cm2-9h8c-rvfx , EUVD-2022-6242
- cvss
- 7.5
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 2.4%
- EPSS 2.4% chance of exploitation in 30 days, percentile 84%
- public exploits
- 0
- none known
Summary
TZInfo is a Ruby library that provides access to time zone data and allows times to be converted using time zone rules. Versions prior to 0.36.1, as well as those prior to 1.2.10 when used with the Ruby data source tzinfo-data, are vulnerable to relative path traversal. With the Ruby data source, time zones are defined in Ruby files. There is one file per time zone. Time zone files are loaded with `require` on demand. In the affected versions, `TZInfo::Timezone.get` fails to validate time zone identifiers correctly, allowing a new line character within the identifier. With Ruby version 1.9.3 and later, `TZInfo::Timezone.get` can be made to load unintended files with `require`, executing them within the Ruby process. Versions 0.3.61 and 1.2.10 include fixes to correctly validate time zone identifiers. Versions 2.0.0 and later are not vulnerable. Version 0.3.61 can still load arbitrary files from the Ruby load path if their name follows the rules for a valid time zone identifier and the file has a prefix of `tzinfo/definition` within a directory in the load path. Applications should ensure that untrusted files are not placed in a directory on the load path. As a workaround, the time zone identifier can be validated before passing to `TZInfo::Timezone.get` by ensuring it matches the regular expression `\A[A-Za-z0-9+\-_]+(?:\/[A-Za-z0-9+\-_]+)*\z`.
Patch / fix
- rubygems tzinfo 0.3.61, 1.2.10
- tzinfo_project tzinfo 0.3.61, 1.2.10
- ruby-tzinfo Debian 14, Debian 13, Debian 12 2.0.4-2
debian advisories DEBIAN-CVE-2022-31163
- cjson satellite capsule 6.13, satellite 6.13 1.7.14-5.el8sat
- foreman satellite utils 6.13, satellite capsule 6.13, satellite 6.13 3.5.1.14-1.el8sat
- katello satellite capsule 6.13, satellite 6.13 4.7.0-1.el8sat
- libsolv satellite capsule 6.13, satellite 6.13 0.7.22-4.el8pc
- libcomps satellite capsule 6.13, satellite 6.13 0.1.18-4.el8pc
- qpid-cpp satellite capsule 6.13, satellite 6.13 1.39.0-7.el8amq
- qpid-qmf satellite capsule 6.13, satellite 6.13 1.39.0-7.el8amq
- candlepin satellite 6.13 4.2.13-1.el8sat
red hat advisories RHSA-2023:2097RHSA-2023:1486RHSA-2022:7242
- rubygem-tzinfo OpenStack Cloud Crowbar 9, OpenStack Cloud Crowbar 8 1.2.2-3.3.1
- rubygem-tzinfo SLE High Availability Extension 15 SP4, SLE High Availability Extension 15 SP3, SLE High Availability Extension 15 SP2 +4 more 1.2.4-150000.3.3.1
suse advisories SUSE-SU-2022:2765-1SUSE-SU-2022:2592-1
- rubygem-tzinfo-1.2 openSUSE Tumbleweed 1.2.11-1.5
- rubygem-tzinfo-1.2 openSUSE Tumbleweed 1.2.10-1.1
- ruby3.2-rubygem-tzinfo-1.2 openSUSE Tumbleweed 1.2.10-1.4
opensuse advisories openSUSE-SU-2024:14178-1openSUSE-SU-2024:12249-1openSUSE-SU-2024:13171-1
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-31163 updated cvss 7.5
rubygem-tzinfo: arbitrary code execution
-
Red Hat OpenShift Container Platform 3.11 rubygem-tzinfoaffected: workaround, no fix available “As a workaround, the time zone identifier can be validated before passing to TZInfo::Timezone.get by ensuring it matches the regular expression \A[A-Za-z0-9+\-_]+(?:\/[A-Za-z0-9+\-_]+)*\z.”
-
Red Hat OpenStack Platform 13 (Queens) Operational Tools rubygem-tzinfoaffected: workaround, no fix planned “As a workaround, the time zone identifier can be validated before passing to TZInfo::Timezone.get by ensuring it matches the regular expression \A[A-Za-z0-9+\-_]+(?:\/[A-Za-z0-9+\-_]+)*\z.”
-
Red Hat Gluster 3.5 Web Administration on RHEL-7 rubygem-tzinfo 1.2.10-1.el7rhgsfixed: vendor fix “As a workaround, the time zone identifier can be validated before passing to TZInfo::Timezone.get by ensuring it matches the regular expression \A[A-Za-z0-9+\-_]+(?:\/[A-Za-z0-9+\-_]+)*\z.” RHSA-2023:1486
-
Red Hat Satellite 6.11 for RHEL 7 tfm-rubygem-tzinfo 1.2.10-1.el7sat Red Hat Satellite 6.11 for RHEL 8 rubygem-tzinfo 1.2.10-1.el8satfixed: vendor fix “As a workaround, the time zone identifier can be validated before passing to TZInfo::Timezone.get by ensuring it matches the regular expression \A[A-Za-z0-9+\-_]+(?:\/[A-Za-z0-9+\-_]+)*\z.” RHSA-2022:7242
-
Red Hat Satellite 6.13 for RHEL 8 rubygem-tzinfo 2.0.5-1.el8satfixed: vendor fix “As a workaround, the time zone identifier can be validated before passing to TZInfo::Timezone.get by ensuring it matches the regular expression \A[A-Za-z0-9+\-_]+(?:\/[A-Za-z0-9+\-_]+)*\z.” RHSA-2023:2097
-
Red Hat Gluster 3.5 Web Administration on RHEL-7 ruby 2.4.9-94.el7rhgs, grafana 5.2.4-6.el7rhgs, ruby-irb 2.4.9-94.el7rhgs, ruby-libs 2.4.9-94.el7rhgs, rubygem-i18n 1.9.1-1.el7rhgs, rubygem-rack 2.2.4-1.el7rhgs, +28 more Red Hat Satellite 6.11 for RHEL 7 foreman 3.1.1.25-1.el7sat, satellite 6.11.4-2.el7sat, foreman-cli 3.1.1.25-1.el7sat, foreman-ec2 3.1.1.25-1.el7sat, foreman-gce 3.1.1.25-1.el7sat, satellite-cli 6.11.4-2.el7sat, +19 more Red Hat Satellite 6.11 for RHEL 8 foreman 3.1.1.25-1.el8sat, satellite 6.11.4-2.el8sat, foreman-cli 3.1.1.25-1.el8sat, foreman-ec2 3.1.1.25-1.el8sat, foreman-gce 3.1.1.25-1.el8sat, rubygem-rack 2.2.3.1-1.el8sat, +19 more Red Hat Satellite 6.13 for RHEL 8 cjson 1.7.14-5.el8sat, katello 4.7.0-1.el8sat, libsolv 0.7.22-4.el8pc, libcomps 0.1.18-4.el8pc, python-idna 3.3-2.el8pc, python-pbr 5.8.0-4.el8pc, +670 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- Proof of concept is public
- Automatable
- no
- Technical impact
- total
- Assessed
- 2 y ago
Exploit prediction
2.45% chance of exploitation in the next 30 days, higher than 84% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- github.com https://github.com/tzinfo/tzinfo/security/advisories/GHSA-5cm2-9h8c-rvfx referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 8.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 3.1 | 7.5 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| rubygems | tzinfo | <0.3.61 >=1.0.0, <1.2.10 |
0.3.61 1.2.10 |
Affected products
- tzinfo tzinfo
Classification
References
-
github.com
/tzinfo/tzinfo/commit/9eddbb5c0e682736f61d0dd803b6031a5db9eadf
web, patch, third-party-advisory
-
github.com
/tzinfo/tzinfo/commit/9905ca93abf7bf3e387bd592406e403cd18334c7
web, patch, third-party-advisory
-
github.com
/tzinfo/tzinfo/security/advisories/GHSA-5cm2-9h8c-rvfx
web, exploit, third-party-advisory
-
github.com
/tzinfo/tzinfo/releases/tag/v0.3.61
web, release-notes, third-party-advisory
-
github.com
/tzinfo/tzinfo/releases/tag/v1.2.10
web, release-notes, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2022/08/msg00009.html
mailing-list, web, third-party-advisory
- lists.debian.org /debian-lts-announce/2024/09/msg00008.html
-
nvd.nist.gov
/vuln/detail/CVE-2022-31163
advisory
-
github.com
/rubysec/ruby-advisory-db/blob/master/gems/tzinfo/CVE-2022-31163.yml
web
-
github.com
/tzinfo/tzinfo
package
Sources
- CVE List CVE-2022-31163
- GitHub Advisory GHSA-5cm2-9h8c-rvfx
- NVD CVE-2022-31163
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.