PT-2022-7288 · Ruby-Git+3 · Ruby-Git+3

Yuki Kokubun

·

Published

2022-01-05

·

Updated

2025-12-15

·

CVE-2022-46648

CVSS v2.0

9.0

High

VectorAV:N/AC:L/Au:S/C:C/I:C/A:C
Name of the Vulnerable Software and Affected Versions ruby-git versions prior to v1.13.0
Description The issue is related to incorrect code generation management in the Ruby/Git library, allowing a remote authenticated attacker to execute arbitrary Ruby code. This can be achieved by having a user load a repository containing a specially crafted filename. The vulnerability is exploited through the incorrect parsing of the output of the git ls-files command, which uses eval() to unescape quoted file names. If a file name contains special characters, such as , the git ls-files command prints the file name in quotes and escapes any special characters, potentially leading to remote code execution.
Recommendations For versions prior to v1.13.0, update to version 1.13.0 or later, which correctly parses any quoted file names. As a temporary workaround, consider restricting the use of the Git#ls files method until a patch is available. Avoid using the eval() function to unquote and unescape special characters in file names.

Exploit

Fix

RCE

Code Injection

Weakness Enumeration

Related Identifiers

ALT-PU-2023-2040
ALT-PU-2023-4279
ALT-PU-2024-7826
BDU:2024-02311
CVE-2022-46648
DLA-3303-1
DLA-4406-1
GHSA-PFPR-3463-C6JH
MGASA-2023-0097
RHSA-2023:5931
RHSA-2023:5979
RHSA-2023:5980
RHSA-2023:6818
RLSA-2023:6818

Affected Products

Alt Linux
Debian
Rocky Linux
Ruby-Git