ubuntu-cve-2022-31163
Vulnerability from osv_ubuntu
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.
{
"affected": [
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "ruby-tzinfo",
"binary_version": "1.2.2-1"
}
]
},
"package": {
"ecosystem": "Ubuntu:16.04:LTS",
"name": "ruby-tzinfo",
"purl": "pkg:deb/ubuntu/ruby-tzinfo@1.2.2-1?arch=source\u0026distro=xenial"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"1.2.2-1"
]
},
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "ruby-tzinfo",
"binary_version": "1.2.5-1"
}
]
},
"package": {
"ecosystem": "Ubuntu:18.04:LTS",
"name": "ruby-tzinfo",
"purl": "pkg:deb/ubuntu/ruby-tzinfo@1.2.5-1?arch=source\u0026distro=bionic"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"1.2.2-2",
"1.2.3-1",
"1.2.5-1"
]
},
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "ruby-tzinfo",
"binary_version": "1.2.6-1"
}
]
},
"package": {
"ecosystem": "Ubuntu:20.04:LTS",
"name": "ruby-tzinfo",
"purl": "pkg:deb/ubuntu/ruby-tzinfo@1.2.6-1?arch=source\u0026distro=focal"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"1.2.5-1",
"1.2.6-1"
]
},
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "ruby-tzinfo",
"binary_version": "2.0.4-3"
}
]
},
"package": {
"ecosystem": "Ubuntu:22.04:LTS",
"name": "ruby-tzinfo",
"purl": "pkg:deb/ubuntu/ruby-tzinfo@2.0.4-3?arch=source\u0026distro=jammy"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"1.2.6-1",
"2.0.4-3"
]
},
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "ruby-tzinfo",
"binary_version": "2.0.6-1"
}
]
},
"package": {
"ecosystem": "Ubuntu:24.04:LTS",
"name": "ruby-tzinfo",
"purl": "pkg:deb/ubuntu/ruby-tzinfo@2.0.6-1?arch=source\u0026distro=noble"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"2.0.5-1",
"2.0.6-1"
]
},
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "ruby-tzinfo",
"binary_version": "2.0.6-1"
}
]
},
"package": {
"ecosystem": "Ubuntu:25.10",
"name": "ruby-tzinfo",
"purl": "pkg:deb/ubuntu/ruby-tzinfo@2.0.6-1?arch=source\u0026distro=questing"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"2.0.6-1"
]
},
{
"ecosystem_specific": {
"binaries": [
{
"binary_name": "ruby-tzinfo",
"binary_version": "2.0.6-1"
}
]
},
"package": {
"ecosystem": "Ubuntu:26.04:LTS",
"name": "ruby-tzinfo",
"purl": "pkg:deb/ubuntu/ruby-tzinfo@2.0.6-1?arch=source\u0026distro=resolute"
},
"ranges": [
{
"events": [
{
"introduced": "0"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"2.0.6-1"
]
}
],
"aliases": [],
"details": "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`.",
"id": "UBUNTU-CVE-2022-31163",
"modified": "2026-05-20T14:56:00Z",
"published": "2022-07-22T04:15:00Z",
"references": [
{
"type": "REPORT",
"url": "https://ubuntu.com/security/CVE-2022-31163"
},
{
"type": "REPORT",
"url": "https://github.com/tzinfo/tzinfo/security/advisories/GHSA-5cm2-9h8c-rvfx"
},
{
"type": "REPORT",
"url": "https://github.com/tzinfo/tzinfo/commit/ca29f349856d62cb2b2edb3257d9ddd2f97b3c27"
},
{
"type": "REPORT",
"url": "https://github.com/tzinfo/tzinfo/releases/tag/v0.3.61"
},
{
"type": "REPORT",
"url": "https://github.com/tzinfo/tzinfo/releases/tag/v1.2.10"
},
{
"type": "REPORT",
"url": "https://www.cve.org/CVERecord?id=CVE-2022-31163"
}
],
"related": [],
"schema_version": "1.7.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"score": "medium",
"type": "Ubuntu"
}
],
"upstream": [
"CVE-2022-31163"
]
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.