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

11 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
debian/ruby-git<1.13.1-1
1.13.1-1
debian/ruby-git<1.13.1-1
1.13.1-1
debian/ruby-git<1.13.1-1
1.13.1-1
debian/ruby-git
1.2.8-1+deb10u11.7.0-1+deb11u11.13.1-1
ubuntu/ruby-git<1.2.8-1ubuntu0.16.04.1~esm1
1.2.8-1ubuntu0.16.04.1~esm1
ubuntu/ruby-git<1.2.8-1ubuntu0.18.04.1~esm1
1.2.8-1ubuntu0.18.04.1~esm1
ubuntu/ruby-git<1.6.0+0-1ubuntu0.1~esm1
1.6.0+0-1ubuntu0.1~esm1
ubuntu/ruby-git<1.9.1-1ubuntu0.1~esm1
1.9.1-1ubuntu0.1~esm1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/git to a version that resolves this vulnerability.

    Fixed in 1.13.0
  2. Upgrade

    Upgrade debian/ruby-git to a version that resolves this vulnerability.

    Fixed in 1.13.1-1
  3. Upgrade

    Upgrade debian/ruby-git to a version that resolves this vulnerability.

    Fixed in 1.2.8-1+deb10u1Fixed in 1.7.0-1+deb11u1Fixed in 1.13.1-1
  4. Upgrade

    Upgrade ubuntu/ruby-git to a version that resolves this vulnerability.

    Fixed in 1.2.8-1ubuntu0.16.04.1~esm1
  5. Upgrade

    Upgrade ubuntu/ruby-git to a version that resolves this vulnerability.

    Fixed in 1.2.8-1ubuntu0.18.04.1~esm1
  6. Upgrade

    Upgrade ubuntu/ruby-git to a version that resolves this vulnerability.

    Fixed in 1.6.0+0-1ubuntu0.1~esm1
  7. Upgrade

    Upgrade ubuntu/ruby-git to a version that resolves this vulnerability.

    Fixed in 1.9.1-1ubuntu0.1~esm1
  8. Upgrade

    Upgrade ruby-git to a version that resolves this vulnerability.

    Fixed in 1.13.0

Event History

Jan 9, 2023
Advisory Published
via GitHub·09:55 PM
Data Sourced
via GitHub·09:55 PM
DescriptionSeverityWeaknessAffected Software
Jan 17, 2023
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
DescriptionWeakness
Data Sourced
via OSV·10:15 AM
DescriptionSeverityAffected Software
Data Sourced
10:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Nov 8, 2023
Data Sourced
via Red Hat·02:17 PM
DescriptionSeverityAffected Software
Apr 4, 2025
Updated
via NVD·07:15 PM
SeverityWeaknessAffected Software
Advisory Published
via GitHub·09:59 PM
Jun 17, 2026
Updated
via NVD·05:12 AM
Affected Software
Dec 2, 2026
Updated
via OSV·02:19 AM
Affected Software

Peer vulnerabilities

Found alongside the following vulnerabilities.

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