Miggo Logo

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

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.92234%
Published
7/21/2022
Updated
1/31/2023
KEV Status
No
Technology
TechnologyRuby

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
tzinforubygems< 0.3.610.3.61
tzinforubygems>= 1.0.0, < 1.2.101.2.10

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper validation in the load_timezone_info method. The commit diff shows the regex was updated from /^...$/ to /\A...\z/, which strictly enforces start/end of string matching (preventing newline bypass). This function is directly responsible for validating identifiers before loading zone files. The public Timezone.get method triggers this validation, but the root cause is the flawed regex in load_timezone_info.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t #### *****t** v*rsions - *.*.** *n* **rli*r. - *.*.* to *.*.* w**n us** wit* t** Ru*y **t* sour** (tzin*o-**t*). #### Vuln*r**ility Wit* t** Ru*y **t* sour** (t** tzin*o-**t* **m *or tzin*o v*rsion *.*.* *n* l*t*r *n* *ui

Reasoning

T** vuln*r**ility st*ms *rom improp*r v*li**tion in t** `lo**_tim*zon*_in*o` m*t*o*. T** *ommit *i** s*ows t** r***x w*s up**t** *rom /^...$/ to /\*...\z/, w*i** stri*tly *n*or**s st*rt/*n* o* strin* m*t**in* (pr*v*ntin* n*wlin* *yp*ss). T*is *un*tio