7.5
CWE
20
Advisory Published
Updated

CVE-2023-40165: Unauthorized gem replacement for full names ending in numbers on rubygems.org

First published: Thu Aug 17 2023(Updated: )

rubygems.org is the Ruby community's primary gem (library) hosting service. Insufficient input validation allowed malicious actors to replace any uploaded gem version that had a platform, version number, or gem name matching `/-\d/`, permanently replacing the legitimate upload in the canonical gem storage bucket, and triggering an immediate CDN purge so that the malicious gem would be served immediately. The maintainers have checked all gems matching the `/-\d/` pattern and can confirm that no unexpected `.gem`s were found. As a result, we believe this vulnerability was _not_ exploited. The easiest way to ensure that a user's applications were not exploited by this vulnerability is to check that all of your downloaded .gems have a checksum that matches the checksum recorded in the RubyGems.org database. RubyGems contributor Maciej Mensfeld wrote a tool to automatically check that all downloaded .gem files match the checksums recorded in the RubyGems.org database. You can use it by running: `bundle add bundler-integrity` followed by `bundle exec bundler-integrity`. Neither this tool nor anything else can prove you were not exploited, but the can assist your investigation by quickly comparing RubyGems API-provided checksums with the checksums of files on your disk. The issue has been patched with improved input validation and the changes are live. No action is required on the part of the user. Users are advised to validate their local gems.

Credit: security-advisories@github.com security-advisories@github.com

Affected SoftwareAffected VersionHow to fix
Rubygems Rubygems.org<2023-08-14

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is CVE-2023-40165?

    CVE-2023-40165 is a vulnerability in rubygems.org, the primary gem hosting service for the Ruby community, which allowed malicious actors to replace uploaded gem versions that had a platform, version number, or gem name matching `/-\d/`.

  • What is the severity of CVE-2023-40165?

    CVE-2023-40165 has a severity rating of 7.4, which is considered high.

  • How does CVE-2023-40165 affect software?

    CVE-2023-40165 affects Rubygems Rubygems.org version up to and excluding 2023-08-14.

  • How can I fix CVE-2023-40165?

    To fix CVE-2023-40165, it is recommended to update to a patched version of Rubygems Rubygems.org when available.

  • What is the Common Weakness Enumeration (CWE) for CVE-2023-40165?

    The CWE for CVE-2023-40165 is CWE-20, which refers to insufficient input validation.

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.
© 2024 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203