Arbitrary Ruby code execution via newline path traversal
Published Jul 21, 2022 · Updated Sep 5, 2024
Relative path traversal in the TZInfo tzinfo library before 0.3.61 and 1.0.0 through 1.2.9 allows remote attackers to execute Ruby files. The TZInfo::Timezone.get method accepts a newline inside a time zone identifier and passes the resulting traversal path to require, which loads and executes an unintended file. Exploitation requires Ruby 1.9.3 or later, the Ruby data source, attacker influence over the identifier, and an attacker-controlled file at a loadable path.
Summary
What happened
Relative path traversal in the TZInfo tzinfo library before 0.3.61 and 1.0.0 through 1.2.9 allows remote attackers to execute Ruby files. The TZInfo::Timezone.get method accepts a newline inside a time zone identifier and passes the resulting traversal path to require, which loads and executes an unintended file. Exploitation requires Ruby 1.9.3 or later, the Ruby data source, attacker influence over the identifier, and an attacker-controlled file at a loadable path.
The record
- CVE
- CVE-2022-31163
- Published
- Jul 21, 2022
- Updated
- Sep 5, 2024
- Vendor
- TZInfo
- Product
- tzinfo
- Classifications
- CWE-641, CWE-22, CWE-625, CWE-23, T1190
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Jul 21, 2022CVE publishedPublication date reported by the CVE source.
- Sep 5, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=< 0.3.61
- Affected versionversion=>= 1.0.0, < 1.2.10
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- TZInfo::Timezone.get newline traversal proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo