CVE-2022-46648: Code Injection

Published Jan 9, 2023
·
Updated

ruby-git is a Ruby library that can be used to create, read and operate Git repositories. ruby-git contains multiple code injection vulnerabilities. If a repository containing a specially crafted filename is loaded to the product, an arbitrary ruby code may be executed.

Other sources

ruby-git versions prior to v1.13.0 allows a remote authenticated attacker to execute an arbitrary ruby code by having a user to load a repository containing a specially crafted filename to the product. This vulnerability is different from CVE-2022-47318.

The git gem, between versions 1.2.0 and 1.12.0, incorrectly parsed the output of the git ls-files command using eval() to unescape quoted file names. If a file name was added to the git repository contained special characters, such as \n, then the git ls-files command would print the file name in quotes and escape any special characters. If the Git#lsfiles method encountered a quoted file name it would use eval() to unquote and unescape any special characters, leading to potential remote code execution. Version 1.13.0 of the git gem was released which correctly parses any quoted file names.

GitHub

Affected Software

3 affected componentsFixes available
Ruby-git Project Ruby-git<1.13.0
Debian Debian Linux=10.0
rubygems/git>=1.2.0<1.13.0
1.13.0

Event History

Jan 9, 2023
Advisory Published
via GitHub·09:55 PM
Jan 17, 2023
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionWeakness
Data Sourced
via NVD·10:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Feb 13, 2023
Data Sourced
via Red Hat·01:42 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-46648?

CVE-2022-46648 is classified as a medium severity vulnerability.

2

How do I fix CVE-2022-46648?

To fix CVE-2022-46648, upgrade ruby-git to version 1.13.0 or later.

3

Who is affected by CVE-2022-46648?

CVE-2022-46648 affects all ruby-git versions prior to 1.13.0.

4

What type of attack is possible with CVE-2022-46648?

CVE-2022-46648 allows a remote authenticated attacker to execute arbitrary Ruby code.

5

What is the impact of CVE-2022-46648?

The impact of CVE-2022-46648 is the potential unauthorized execution of Ruby code from a malicious repository.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203