CVE-2022-31163TZInfo relative path traversal vulnerability allows loading of arbitrary files
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`.
What to do
Fixed builds are available from Debian, RubyGems: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | ruby-tzinfo | Fix pending | UBUNTU-CVE-2022-31163 | |
| Ubuntu 26.04 | ruby-tzinfo | Under investigation | UBUNTU-CVE-2022-31163 | |
| Ubuntu 25.10 | ruby-tzinfo | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2022-31163 | |
| Ubuntu 24.04 | ruby-tzinfo | Under investigation | UBUNTU-CVE-2022-31163 | |
| Ubuntu 22.04 | ruby-tzinfo | Under investigation | UBUNTU-CVE-2022-31163 | |
| Ubuntu 20.04 | ruby-tzinfo | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2022-31163 | |
| Ubuntu 18.04 | ruby-tzinfo | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2022-31163 | |
| Ubuntu 16.04 | ruby-tzinfo | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2022-31163 | |
| Ubuntu 14.04 | ruby-tzinfo | Will not fix Ubuntu decided not to fix this in this release | ||
| Debian 14 | ruby-tzinfo | Fixed | 2.0.4-2 | DEBIAN-CVE-2022-31163 |
| Debian 13 | ruby-tzinfo | Fixed | 2.0.4-2 | DEBIAN-CVE-2022-31163 |
| Debian 12 | ruby-tzinfo | Fixed | 2.0.4-2 | DEBIAN-CVE-2022-31163 |
| RubyGems library | tzinfo | Fixed | 1.2.10 | GHSA-5cm2-9h8c-rvfx |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- tzinfo: affected: < 0.3.61, >= 1.0.0, < 1.2.10
References
- https://github.com/tzinfo/tzinfo/security/advisories/GHSA-5cm2-9h8c-rvfx
- https://github.com/tzinfo/tzinfo/releases/tag/v0.3.61
- https://github.com/tzinfo/tzinfo/releases/tag/v1.2.10
- https://github.com/tzinfo/tzinfo/commit/9eddbb5c0e682736f61d0dd803b6031a5db9eadf
- https://github.com/tzinfo/tzinfo/commit/9905ca93abf7bf3e387bd592406e403cd18334c7
- https://lists.debian.org/debian-lts-announce/2022/08/msg00009.html
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.