CVEfocus › CVE database › CVE-2022-31163

CVE-2022-31163TZInfo relative path traversal vulnerability allows loading of arbitrary files

CVSS 7.5 HighEPSS 2.2% (higher than 83% of CVEs)Published 2022-07-21Updated 2024-09-05Assigner: GitHub_M

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`.

CWE-22CWE-23

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

4Fixed
1Fix pending
3Under investigation
5Will not fix

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.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10ruby-tzinfoFix pendingUBUNTU-CVE-2022-31163
Ubuntu 26.04ruby-tzinfoUnder investigationUBUNTU-CVE-2022-31163
Ubuntu 25.10ruby-tzinfoWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2022-31163
Ubuntu 24.04ruby-tzinfoUnder investigationUBUNTU-CVE-2022-31163
Ubuntu 22.04ruby-tzinfoUnder investigationUBUNTU-CVE-2022-31163
Ubuntu 20.04ruby-tzinfoWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2022-31163
Ubuntu 18.04ruby-tzinfoWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2022-31163
Ubuntu 16.04ruby-tzinfoWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2022-31163
Ubuntu 14.04ruby-tzinfoWill not fix
Ubuntu decided not to fix this in this release
Debian 14ruby-tzinfoFixed2.0.4-2DEBIAN-CVE-2022-31163
Debian 13ruby-tzinfoFixed2.0.4-2DEBIAN-CVE-2022-31163
Debian 12ruby-tzinfoFixed2.0.4-2DEBIAN-CVE-2022-31163
RubyGems librarytzinfoFixed1.2.10GHSA-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.

References

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.